MalletMain Page | About | Help | FAQ | Special pages | Log in
Advanced Machine Learning for Language
Printable version | Disclaimers

Jython:Intro

From Mallet

Version 0.4

For version 0.4 of mallet, a script called mallethon (in the bin directory) has been prepared. In order to get mallethon to work, you need to set the environment variable JAVA_HOME to point to the directory where the JDK resides. For example, on our system the java executable is at

/usr/java/jdk1.5.0_04/bin/java

and we set

JAVA_HOME=/usr/java/jdk1.5.0_04

Then use mallethon as the interpreter (in much the same way you would if you were using python). For example:

../bin/mallethon TrainCRF.py -f training_file -m save_model_here

Gotchas

Please note that Jython requires JDK 1.5, while MALLET has been developed and heavily tested with JDK 1.4. Please report problems to mallet-dev at cs.umass.edu.

Old instructions

In order to use mallet from jython, you will need both Mallet and Jython. Mallet is available here, while Jython is available at the Jython site (http://www.jython.org/). You will also need to set your classpath to include: <MALLET>/class:<MALLET>/lib/bsh.jar:<MALLET>/lib/junit.jar

For example, if MALLET is installed in /data/mallet/ then you would need to run (for bash-style shell users):

export
CLASSPATH=/data/mallet/class:/data/mallet/lib/bsh.jar:/data/mallet/lib/junit.jar:$CLASSPATH


Finally, in order to use modules written in jython, you need to add a python path to a file called ~/.jython. For example, if mallet is installed in /data/mallet/ then you can create the necessary file with the command:


echo python.path=/data/mallet/pylib/:/data/mallet/class/ > ~/.jython

Retrieved from "http://mallet.cs.umass.edu/index.php/Jython:Intro"

This page has been accessed 4632 times. This page was last modified 23:18, 21 Dec 2005.


Find
Navigation
Main Page
Community portal
Recent changes
Random page
Help
Donations
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Create an account or log in
Special pages
New pages
Image list
Statistics
Bug reports
More...