|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.creole.ml.maxent.MaxentWrapper
public class MaxentWrapper
Wrapper class for the Maxent machine learning algorithm.
Nested Class Summary | |
---|---|
protected class |
MaxentWrapper.LoadModelAction
This reloads a file that was previously saved using the SaveModelAction class. |
protected class |
MaxentWrapper.SaveModelAction
This allows the model, including its parameters to be saved to a file. |
Field Summary | |
---|---|
protected List |
actionsList
|
protected double |
confidenceThreshold
|
protected int |
cutoff
The following members are set by the |
protected boolean |
datasetChanged
Marks whether the dataset was changed since the last time the classifier was built. |
protected DatasetDefintion |
datasetDefinition
|
protected int |
iterations
|
protected opennlp.maxent.MaxentModel |
maxentClassifier
The Maxent classifier used by this wrapper |
protected org.jdom.Element |
optionsElement
The JDom element contaning the options fro this wrapper. |
protected ProcessingResource |
owner
|
protected StatusListener |
sListener
|
protected boolean |
smoothing
|
protected double |
smoothingObservation
|
protected List |
trainingData
This List stores all the data that has been collected. |
protected boolean |
verbose
|
Constructor Summary | |
---|---|
MaxentWrapper()
This constructor sets up action list so that these actions (loading and saving models and data) will be available from a context menu in the gui). |
Method Summary | |
---|---|
void |
addTrainingInstance(List attributeValues)
This is called to add a new training instance to the data set collected in this wrapper object. |
List |
batchClassifyInstances(List instances)
Some wrappers allow batch classification, but this one doesn't, so if it's ever called just inform the user about this by throwing an exception. |
Object |
classifyInstance(List attributeValues)
Decide on the outcome for the instance, based on the values of all the maxent features. |
void |
cleanUp()
No clean up is needed for this wrapper, so this is just added because its in the interface. |
List |
getActions()
Gets the list of actions that can be performed on this resource. |
DatasetDefintion |
getDatasetDefinition()
|
void |
init()
Initialises the classifier and prepares for running. |
void |
load(InputStream is)
Loads the state of this engine from previously saved data. |
void |
save(OutputStream os)
Saves the state of the engine for reuse at a later time. |
void |
setDatasetDefinition(DatasetDefintion definition)
Set the data set defition for this classifier. |
void |
setOptions(org.jdom.Element optionsElem)
Take a representation of the part of the XML configuration file which corresponds to |
void |
setOwnerPR(ProcessingResource pr)
Registers the PR using the engine with the engine itself. |
boolean |
supportsBatchMode()
Returns true if the engine supports BatchMode, returns false otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DatasetDefintion datasetDefinition
protected opennlp.maxent.MaxentModel maxentClassifier
protected List trainingData
protected org.jdom.Element optionsElement
protected boolean datasetChanged
protected List actionsList
protected ProcessingResource owner
protected StatusListener sListener
protected int cutoff
protected double confidenceThreshold
protected int iterations
protected boolean verbose
protected boolean smoothing
protected double smoothingObservation
Constructor Detail |
---|
public MaxentWrapper()
Method Detail |
---|
public void cleanUp()
cleanUp
in interface MLEngine
public List batchClassifyInstances(List instances) throws ExecutionException
batchClassifyInstances
in interface MLEngine
instances
- This parameter is not used.
ExecutionException
public void setOptions(org.jdom.Element optionsElem)
setOptions
in interface MLEngine
optionsElem
- the JDom element containing the options from the
configuration.
GateException
public void addTrainingInstance(List attributeValues)
addTrainingInstance
in interface MLEngine
attributeValues
- A list of String objects, each of which corresponds
to an attribute value. For boolean attributes the values will be true or
false.public void setDatasetDefinition(DatasetDefintion definition)
setDatasetDefinition
in interface MLEngine
definition
- A specification of the types and allowable values of
all the attributes, as specified in the public Object classifyInstance(List attributeValues) throws ExecutionException
classifyInstance
in interface MLEngine
attributeValues
- A list of all the attributes, including the one that
corresponds to the maxent outcome (the ExecutionException
public void init() throws GateException
init
in interface MLEngine
GateException
- If it is not possible to initialise the classifier
for any reason.public void load(InputStream is) throws IOException
is
- An open InputStream from which the model will be loaded.
IOException
public void save(OutputStream os) throws IOException
os
- An open output stream to which the model will be saved.
IOException
public List getActions()
getActions
in interface ActionsPublisher
public void setOwnerPR(ProcessingResource pr)
setOwnerPR
in interface MLEngine
pr
- the processing resource that owns this engine.public DatasetDefintion getDatasetDefinition()
public boolean supportsBatchMode()
AdvancedMLEngine
supportsBatchMode
in interface AdvancedMLEngine
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |