[Problem and Solution] NLTK was unable to find the megam file! (1)

Source: Internet
Author: User
Tags ocaml nltk

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]

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.