Package opennlp.tools.ml
Class AbstractEventTrainer
java.lang.Object
opennlp.tools.ml.AbstractTrainer
opennlp.tools.ml.AbstractEventTrainer
- All Implemented Interfaces:
Trainer,EventTrainer
- Direct Known Subclasses:
GISTrainer,NaiveBayesTrainer,PerceptronTrainer,QNTrainer
A basic
EventTrainer implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface opennlp.tools.ml.EventTrainer
EVENT_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract MaxentModeldoTrain(DataIndexer indexer) getDataIndexer(ObjectStream<Event> events) abstract booleanfinal MaxentModeltrain(DataIndexer indexer) Trains aMaxentModelfor givenevents.final MaxentModeltrain(ObjectStream<Event> events) Trains aMaxentModelfor givenevents.voidvalidate()Checks the configuredparameters.Methods inherited from class opennlp.tools.ml.AbstractTrainer
getAlgorithm, getCutoff, getIterations, init
-
Field Details
-
DATA_INDEXER_PARAM
- See Also:
-
DATA_INDEXER_ONE_PASS_VALUE
- See Also:
-
DATA_INDEXER_TWO_PASS_VALUE
- See Also:
-
DATA_INDEXER_ONE_PASS_REAL_VALUE
- See Also:
-
-
Constructor Details
-
AbstractEventTrainer
public AbstractEventTrainer() -
AbstractEventTrainer
-
-
Method Details
-
validate
public void validate()Description copied from class:AbstractTrainerChecks the configuredparameters. If a subclass overrides this, it should callsuper.validate();.- Overrides:
validatein classAbstractTrainer
-
isSortAndMerge
public abstract boolean isSortAndMerge() -
getDataIndexer
- Throws:
IOException
-
doTrain
- Throws:
IOException
-
train
Description copied from interface:EventTrainerTrains aMaxentModelfor givenevents.- Specified by:
trainin interfaceEventTrainer- Parameters:
indexer- The inputindexerto use.- Returns:
- The trained
MaxentModel. - Throws:
IOException- Thrown if IO errors occurred.
-
train
Description copied from interface:EventTrainerTrains aMaxentModelfor givenevents.- Specified by:
trainin interfaceEventTrainer- Parameters:
events- The inputevents.- Returns:
- The trained
MaxentModel. - Throws:
IOException- Thrown if IO errors occurred.
-