<p>我有一个使用NLTK查找名词和动词的代码。在</p>
<pre><code>from nltk.corpus import wordnet as wn
from nltk import pos_tag
import nltk
sentence = "Hello my name is Abhishek Mitra"
sentence = nltk.word_tokenize(sentence)
sent = pos_tag(sentence)
print sent
</code></pre>
<p>它返回:</p>
^{pr2}$
<p>我怎样才能只从列表中删除'NN'单词。在</p>
<pre><code>a = [('Hello', 'NNP'), ('my', 'PRP$'), ('name', 'NN'), ('is', 'VBZ'), ('Abhishek', 'NNP'), ('Mitra', 'NNP')]
c = [b for b in a if b[-1] != 'NN']
</code></pre>