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 basicEventTrainer
implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATA_INDEXER_ONE_PASS_REAL_VALUE
static String
DATA_INDEXER_ONE_PASS_VALUE
static String
DATA_INDEXER_PARAM
static String
DATA_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 MaxentModel
doTrain(DataIndexer indexer)
DataIndexer
getDataIndexer(ObjectStream<Event> events)
abstract boolean
isSortAndMerge()
boolean
isValid()
Deprecated.Usevalidate()
instead.MaxentModel
train(DataIndexer indexer)
Trains aMaxentModel
for givenevents
.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, 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:AbstractTrainer
Checks the configuredparameters
. If a subclass overrides this, it should callsuper.validate();
.- Overrides:
validate
in classAbstractTrainer
-
isValid
@Deprecated public boolean isValid()
Deprecated.Usevalidate()
instead.- Overrides:
isValid
in classAbstractTrainer
- Returns:
true
if the validation of the internal configuration succeeds,false
otherwise.
-
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: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
public final MaxentModel train(ObjectStream<Event> events) throws IOException
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.
-
-