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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from interface opennlp.tools.ml.EventTrainer
EVENT_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract MaxentModel
doTrain
(DataIndexer indexer) getDataIndexer
(ObjectStream<Event> events) abstract boolean
final MaxentModel
train
(DataIndexer indexer) Trains aMaxentModel
for givenevents
.final MaxentModel
train
(ObjectStream<Event> events) Trains aMaxentModel
for givenevents
.void
validate()
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:AbstractTrainer
Checks the configuredparameters
. If a subclass overrides this, it should callsuper.validate();
.- Overrides:
validate
in classAbstractTrainer
-
isSortAndMerge
public abstract boolean isSortAndMerge() -
getDataIndexer
- Throws:
IOException
-
doTrain
- Throws:
IOException
-
train
Description copied from interface:EventTrainer
Trains aMaxentModel
for givenevents
.- Specified by:
train
in interfaceEventTrainer
- Parameters:
indexer
- The inputindexer
to use.- Returns:
- The trained
MaxentModel
. - Throws:
IOException
- Thrown if IO errors occurred.
-
train
Description copied from interface:EventTrainer
Trains aMaxentModel
for givenevents
.- Specified by:
train
in interfaceEventTrainer
- Parameters:
events
- The inputevents
.- Returns:
- The trained
MaxentModel
. - Throws:
IOException
- Thrown if IO errors occurred.
-