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
public abstract class AbstractEventTrainer extends AbstractTrainer implements EventTrainer
A basicEventTrainerimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_INDEXER_ONE_PASS_REAL_VALUEstatic StringDATA_INDEXER_ONE_PASS_VALUEstatic StringDATA_INDEXER_PARAMstatic StringDATA_INDEXER_TWO_PASS_VALUE-
Fields inherited from class opennlp.tools.ml.AbstractTrainer
ALGORITHM_PARAM, CUTOFF_DEFAULT, CUTOFF_PARAM, ITERATIONS_DEFAULT, ITERATIONS_PARAM, TRAINER_TYPE_PARAM, VERBOSE_DEFAULT, VERBOSE_PARAM
-
Fields inherited from interface opennlp.tools.ml.EventTrainer
EVENT_VALUE
-
-
Constructor Summary
Constructors Constructor Description AbstractEventTrainer()AbstractEventTrainer(TrainingParameters parameters)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract MaxentModeldoTrain(DataIndexer indexer)DataIndexergetDataIndexer(ObjectStream<Event> events)abstract booleanisSortAndMerge()booleanisValid()Deprecated.Usevalidate()instead.MaxentModeltrain(DataIndexer indexer)Trains aMaxentModelfor givenevents.MaxentModeltrain(ObjectStream<Event> events)Trains aMaxentModelfor givenevents.voidvalidate()Checks the configuredparameters.-
Methods inherited from class opennlp.tools.ml.AbstractTrainer
getAlgorithm, getCutoff, getIterations, init, init
-
-
-
-
Field Detail
-
DATA_INDEXER_PARAM
public static final String DATA_INDEXER_PARAM
- See Also:
- Constant Field Values
-
DATA_INDEXER_ONE_PASS_VALUE
public static final String DATA_INDEXER_ONE_PASS_VALUE
- See Also:
- Constant Field Values
-
DATA_INDEXER_TWO_PASS_VALUE
public static final String DATA_INDEXER_TWO_PASS_VALUE
- See Also:
- Constant Field Values
-
DATA_INDEXER_ONE_PASS_REAL_VALUE
public static final String DATA_INDEXER_ONE_PASS_REAL_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractEventTrainer
public AbstractEventTrainer()
-
AbstractEventTrainer
public AbstractEventTrainer(TrainingParameters parameters)
-
-
Method Detail
-
validate
public void validate()
Description copied from class:AbstractTrainerChecks the configuredparameters. If a subclass overrides this, it should callsuper.validate();.- Overrides:
validatein classAbstractTrainer
-
isValid
@Deprecated public boolean isValid()
Deprecated.Usevalidate()instead.- Overrides:
isValidin classAbstractTrainer- Returns:
trueif the validation of the internal configuration succeeds,falseotherwise.
-
isSortAndMerge
public abstract boolean isSortAndMerge()
-
getDataIndexer
public DataIndexer getDataIndexer(ObjectStream<Event> events) throws IOException
- Throws:
IOException
-
doTrain
public abstract MaxentModel doTrain(DataIndexer indexer) throws IOException
- Throws:
IOException
-
train
public final MaxentModel train(DataIndexer indexer) throws IOException
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
public final MaxentModel train(ObjectStream<Event> events) throws IOException
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.
-
-