notebook.community
Edit and run
In [1]: import nltk
import nltk
In [2]: text = "Jack and Jill went to Capitol Hill" print nltk.pos_tag(nltk.word_tokenize(text))
text = "Jack and Jill went to Capitol Hill" print nltk.pos_tag(nltk.word_tokenize(text))
[('Jack', 'NNP'), ('and', 'CC'), ('Jill', 'NNP'), ('went', 'VBD'), ('to', 'TO'), ('Capitol', 'NNP'), ('Hill', 'NNP')]
In [ ]: