>>> from nltk.tag import pos_tag
>>> a = ['What', 'is', 'your', 'first', 'and', 'last', 'name', '.']
>>> pos_tUse NLTK’s currently recommended part of speech tagger to tag the given list of tokens.ag(a)
[('What', 'WP'), ('is', 'VBZ'), ('your', 'PRP$'), ('first', 'JJ'), ('and', 'CC'), ('last', 'JJ'), ('name', 'NN'), ('.', '.')]
pos_tag
Use NLTK’s currently recommended part of speech tagger to tag the given list of tokens.
NLTK为您提供函数post_标记:
您可以在此处检查pos_标记结果的含义: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
您可以使用^{} 模块中的
pos_tag
函数:也可以使用
pos_tag_sents
标记给定的句子列表。在相关问题 更多 >
编程相关推荐