GATE
Version 3.1-2270

gate.creole.ml
Class MachineLearningPR

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.creole.AbstractProcessingResource
              extended by gate.creole.AbstractLanguageAnalyser
                  extended by gate.creole.ml.MachineLearningPR
All Implemented Interfaces:
ANNIEConstants, Executable, ActionsPublisher, LanguageAnalyser, ProcessingResource, Resource, FeatureBearer, NameBearer, Serializable

public class MachineLearningPR
extends AbstractLanguageAnalyser
implements ActionsPublisher

This processing resource is used to train a machine learning algorithm with data extracted from a corpus.

See Also:
Serialized Form

Nested Class Summary
protected  class MachineLearningPR.Cache
           
 
Nested classes/interfaces inherited from class gate.creole.AbstractProcessingResource
AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener
 
Field Summary
protected  List actionList
           
protected  List annotations
           
protected  AnnotationSet annotationSet
           
protected  boolean batchModeClassification
          This member will be set to true if instances are to be passed to the wrapper in batches, rather than one instance at a time and if the engine supports this functionality.
protected  MachineLearningPR.Cache cache
           
protected  DatasetDefintion datasetDefinition
           
protected  MLEngine engine
           
protected  String inputASName
           
 
Fields inherited from class gate.creole.AbstractLanguageAnalyser
corpus, document
 
Fields inherited from class gate.creole.AbstractProcessingResource
interrupted
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.creole.ANNIEConstants
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DATE_POSTED_ANNOTATION_TYPE, DOCUMENT_COREF_FEATURE_NAME, JOB_ID_ANNOTATION_TYPE, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, LOOKUP_ONTOLOGY_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME
 
Constructor Summary
MachineLearningPR()
           
 
Method Summary
 void cleanup()
          This will make sure that any resources allocated by an ml wrapper get released.
 void execute()
          Run the resource.
 List getActions()
          Gets the list of actions that can be performed on this resource.
 URL getConfigFileURL()
           
 MLEngine getEngine()
           
 String getInputASName()
           
 Boolean getTraining()
           
 Resource init()
          Initialise this resource, and return it.
 void setConfigFileURL(URL configFileURL)
           
 void setEngine(MLEngine engine)
           
 void setInputASName(String inputASName)
           
 void setTraining(Boolean training)
           
protected  void updateDocument(Object classificationResult, int instanceIndex)
           
 
Methods inherited from class gate.creole.AbstractLanguageAnalyser
getCorpus, getDocument, setCorpus, setDocument
 
Methods inherited from class gate.creole.AbstractProcessingResource
addProgressListener, addStatusListener, fireProcessFinished, fireProgressChanged, fireStatusChanged, interrupt, isInterrupted, reInit, removeProgressListener, removeStatusListener
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.ProcessingResource
reInit
 
Methods inherited from interface gate.Resource
getParameterValue, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 
Methods inherited from interface gate.Executable
interrupt, isInterrupted
 

Field Detail

datasetDefinition

protected DatasetDefintion datasetDefinition

engine

protected MLEngine engine

inputASName

protected String inputASName

annotationSet

protected AnnotationSet annotationSet

annotations

protected List annotations

actionList

protected List actionList

cache

protected MachineLearningPR.Cache cache

batchModeClassification

protected boolean batchModeClassification
This member will be set to true if instances are to be passed to the wrapper in batches, rather than one instance at a time and if the engine supports this functionality.

Constructor Detail

MachineLearningPR

public MachineLearningPR()
Method Detail

cleanup

public void cleanup()
This will make sure that any resources allocated by an ml wrapper get released. This is needed in the case of those wrappers that call native code, as in such cases there is a need to realese dynamically allocated memory.

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractProcessingResource

init

public Resource init()
              throws ResourceInstantiationException
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractProcessingResource
Throws:
ResourceInstantiationException

execute

public void execute()
             throws ExecutionException
Run the resource.

Specified by:
execute in interface Executable
Overrides:
execute in class AbstractProcessingResource
Throws:
ExecutionException

updateDocument

protected void updateDocument(Object classificationResult,
                              int instanceIndex)

getActions

public List getActions()
Gets the list of actions that can be performed on this resource.

Specified by:
getActions in interface ActionsPublisher
Returns:
a List of Action objects (or null values)

setInputASName

public void setInputASName(String inputASName)

getInputASName

public String getInputASName()

getConfigFileURL

public URL getConfigFileURL()

setConfigFileURL

public void setConfigFileURL(URL configFileURL)

setTraining

public void setTraining(Boolean training)

getTraining

public Boolean getTraining()

getEngine

public MLEngine getEngine()

setEngine

public void setEngine(MLEngine engine)

GATE
Version 3.1-2270