Tagging a single word with the nltk pos tagger tags each letter instead of the word

后端 未结 4 920
傲寒
傲寒 2021-01-18 02:55

I\'m try to tag a single word with the nltk pos tagger:

word = \"going\"
pos = nltk.pos_tag(word)
print pos

But the output is this:

4条回答
  •  星月不相逢
    2021-01-18 03:09

    >>> word = 'going'
    >>> word = nltk.word_tokenize(word)
    >>> l1 = nltk.pos_tag(word)
    >>> l1
    [('going', 'VBG')]
    

提交回复
热议问题