stuck in using Megam in Python ( nltk.classify.MaxentClassifier)

For the future users:

megam is now available on MAC through brew:

$brew tap homebrew/science
$brew install megam

Use config_megam() to tell NLTK where the Megam executable is located. See: http://nltk.googlecode.com/svn/trunk/doc/api/nltk.classify.megam-module.html for details and documentation.

You also need to build MEGAM with the right 32/64 bit setting for your system. "megam_i686.opt" is for x86 iirc, so you should compile it for 64 bit. It is a while since I did this, but a simple build on an x64 system was all I needed: "Make doesn't work" is not very useful: I'm sure it gave you a few error messages...? Probably paths not set or are read only?


Edit: Looks like the above link is currently broken. The main Megam site can be found at:

http://www.umiacs.umd.edu/~hal/megam/

although it hasn't been updated for a while.


Answer given by Hugh Perkins, helped me resolve the issue (due to low reputation can't add a comment to that answer). After downloading the zip file (from http://thinknook.com/wp-content/uploads/2012/11/MEGAM.zip), I needed to tell python where it was, and that was done by adding it in os.environ as:

os.environ["MEGAM"] = '<<Complete path followed by file name>>/megam-64'