I'm trying to implement a sentence chunker based on a Maxent Classifier, as described in the NLTK book (Example 7.9):
http://nltk.googlecode.com/svn/trunk/doc/book/ch07.html#code-classifier-chunker
When I try to evaluate the chunker with
chunker = ConsecutiveNPChunker(train_sents)
print chunker.evaluate(test_sents)
or to chunk a sentence with
print chunker.parse(test_sents[1])
I receive the following error:
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
I didn't find anything on google and I'm stuck on this point. Any help would be really useful!