In [1]:
import nltk

In [2]:
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')]

You Try It

  1. Find the first sentence in Alice in wonderland
  2. Find the POS tags

In [ ]: