我使用混淆矩阵跟随NLTK书,但confusionmatrix看起来很奇怪.
#empirically exam where tagger is making mistakes
test_tags = [tag for sent in brown.sents(categories='editorial')
for (word, tag) in t2.tag(sent)]
gold_tags = [tag for (word, tag) in brown.tagged_words(categories='editorial')]
print nltk.ConfusionMatrix(gold_tags, test_tags)
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释如何使用混淆矩阵?