Package nltk :: Package classify :: Module mallet
[hide private]
[frames] | no frames]

Module mallet

source code

A set of functions used to interface with the external Mallet machine learning package. Before mallet can be used, you should tell NLTK where it can find the mallet package, using the config_mallet() function. Typical usage:

>>> import nltk
>>> nltk.config_mallet('.../path/to/mallet')
Functions [hide private]
    Configuration
 
config_mallet(mallet_home=None)
Configure NLTK's interface to the mallet machine learning package.
source code
 
call_mallet(cmd, classpath=None, stdin=None, stdout=None, stderr=None, blocking=True)
Call nltk.internals.java() with the given command, and with the classpath modified to include both nltk.jar and all the .jar files defined by Mallet.
source code
Variables [hide private]
    Configuration
  _mallet_home = None
  _mallet_classpath = None
Function Details [hide private]

config_mallet(mallet_home=None)

source code 

Configure NLTK's interface to the mallet machine learning package.

Parameters:
  • mallet_home (string) - The full path to the mallet directory. If not specified, then nltk will search the system for a mallet directory; and if one is not found, it will raise a LookupError exception.

call_mallet(cmd, classpath=None, stdin=None, stdout=None, stderr=None, blocking=True)

source code 

Call nltk.internals.java() with the given command, and with the classpath modified to include both nltk.jar and all the .jar files defined by Mallet.

See nltk.internals.java() for parameter and return value descriptions.