gate.creole.ml
Class MachineLearningPR
java.lang.Object
gate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractProcessingResource
gate.creole.AbstractLanguageAnalyser
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
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 |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
MachineLearningPR
public MachineLearningPR()
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)