0

我有以下代码

import nltk
from nltk.corpus.reader import TaggedCorpusReader

corpus_root = 'C:/Python27'
reader = TaggedCorpusReader(corpus_root, 'test.txt')
print reader.words()
print reader.tagged_words()

问题是在结果中给我每个单词的值“无”..

[('And', 'None'), ('now', 'None')..

当我有这个代码时

import nltk
text = nltk.word_tokenize("And now for something completely different")
nltk.pos_tag(text)

结果是对的……

[('And', 'CC'), ('now', 'RB'), ('for', 'IN'), ('something', 'NN'), ('completely', 'RB'), ('different', 'JJ')]

出了什么问题??

4

0 回答 0