1import nltk
2
3from nltk.tokenize import sent_tokenize
4from nltk.corpus import gutenberg
5sample = gutenberg.raw("blake-poems.txt")
6tokenized = sent_tokenize(sample)
7for i in tokenized[:2]:
8 words = nltk.word_tokenize(i)
9 tagged = nltk.pos_tag(words)
10 print(tagged)
11