Part of Speech Tagging
from nltk import pos_tag,word_tokenize
sentence1 = 'this is a demo that will show you how
to detects parts of speech with little effort
using NLTK!'
tokenized_sent = word_tokenize(sentence1)
print pos_tag(tokenized_sent)
[('this', 'DT'), ('is', 'VBZ'), ('a', 'DT'), ('demo', 'NN'), ('that', 'WDT'),
('will', 'MD'), ('show', 'VB'), ('you', 'PRP'), ('how', 'WRB'), ('to', 'TO'),
('detects', 'NNS'), ('parts', 'NNS'), ('of', 'IN'), ('speech', 'NN'), ('with',
'IN'), ('little', 'JJ'), ('effort', 'NN'), ('using', 'VBG'), ('NLTK', 'NNP'),('!',
'.')]
ISE,DSCE-2013 15