title: Filter Specific Part of Speech NLTK
body: <p>this must be simple but I'm missing it somehow.  I have the code:</p>
  
  <pre><code>import nltk
  
  f=open('...\\t.txt','rU')
  raw=f.read()
  tokens = nltk.word_tokenize(raw)
  print nltk.pos_tag(tokens)
  </code></pre>
  
  <p>which returns for instance:</p>
  
  <p>"[('processes', 'NNS'), ('a', 'DT'), ('sequence', 'NN'), ('of', 'IN'), ('words', 'NNS')]</p>
  
  <p>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.</p>
  
  <p>thanks in advance</p>