0
我刚刚学习使用Python的nltk。我正在使用POS标记。我想知道的是如何使用标签。例如,这是伪代码:检查Nltk POS标签
words = []
teststr = "George did well in the test."
tokens = nltk.word_tokenize(teststr)
words = nltk.pos_tag(tokens)
我想要做这样的事情:
if words[i] == "proper noun":
#do something
如何检查一个单词是否是名词或动词或语音的任何其他部分。 有人可以帮我在这里吗? 谢谢。
非常感谢瑞恩!我现在明白了。对不起,没有声望,所以不能upvote。 – user2201130 2013-03-22 23:34:31