When I learned the section "training classifier-based splitters", I encountered a problem after testing the code.
= tagged_sent == i, (word, tag) == nltk.MaxentClassifier.train(train_set, algorithm=, trace== i, word == zip(sentence, history)
= [[((w,t),c) (w,t,c) sent ===[(w,t,c) ((w,t),c) nltk.chunk.conlltags2tree(conlltags)
= {>>>chunker =>>> chunker.evaluate(test_sents)
The above is the Code provided in the book. The problem is that when you execute
Chunker = ConsecutiveNPChunker (train_sents) was not executed as scheduled, but an error occurred.
, line 1, <module>=, line 5, =, line 11, = nltk.MaxentClassifier.train(train_set, algorithm=, trace=, line 319, **, line 1522, =, line 163, , line 59, =, line 528, , line 512, LookupError( %===========================================================================
Although the corresponding prompt is given, it is not completely.
Through Google's search, I found some solutions.
My operating system is Windows 8.
The nltk language tool official website provides the following tips:
Https://sites.google.com/site/naturallanguagetoolkit/download
Megam is an optional package and can be installed later. Download URL: MegaM: http://hal3.name/megam/megam_src.tgz. download directly without success, and use thunder to download success.
However, after opening the file, it is found that some source files are used. However, there is a README file in the compressed package, which provides instructions on how to use it. We found that we still need to install something.
In README, write: ocamlHttp://caml.inria.fr)
I need to download the source file compiler from this website, so I downloaded a version that matches my computer system, but it seems that the installation still needs to be considered. During the installation process, a virus is prompted, but I still choose trust, or I cannot continue.
[Now Ocaml is being installed. I want to install it completely (it may not be necessary to install it completely). After the installation is complete, I will continue to explore how to solve this problem]