this must be simple but I'm missing it somehow. I have the code:
import nltk
f=open('...\\t.txt','rU')
raw=f.read()
tokens = nltk.word_tokenize(raw)
print nltk.pos_tag(tokens)
which returns for instance:
"[('processes', 'NNS'), ('a', 'DT'), ('sequence', 'NN'), ('of', 'IN'), ('words', 'NNS')]
I was wondering how I could just collected solely all 'NN' for example or all 'DT' AND 'IN' instead of every member of the string.
thanks in advance