我正在尝试实现基于 Maxent 分类器的句子分块器,如 NLTK 书(示例 7.9)中所述:
http://nltk.googlecode.com/svn/trunk/doc/book/ch07.html#code-classifier-chunker
当我尝试用
chunker = ConsecutiveNPChunker(train_sents)
print chunker.evaluate(test_sents)
或用
print chunker.parse(test_sents[1])
我收到以下错误:
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
print chunker.parse(test_sents[1])
File "/usr/local/lib/python2.6/dist-packages/nltk/chunk/api.py", line 34, in parse
assert 0, "ChunkParserI is an abstract interface"
AssertionError: ChunkParserI is an abstract interface
我在谷歌上没有找到任何东西,我被困在这一点上。任何帮助都会非常有用!