Package opennlp.tools.ml
Class AbstractTrainer
java.lang.Object
opennlp.tools.ml.AbstractTrainer
- All Implemented Interfaces:
Trainer
- Direct Known Subclasses:
AbstractEventModelSequenceTrainer,AbstractEventTrainer
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractTrainer(TrainingParameters trainParams) Initializes aAbstractTrainerviaTrainingParameters. -
Method Summary
Modifier and TypeMethodDescriptionintintvoidinit(TrainingParameters trainParams, Map<String, String> reportMap) voidvalidate()Checks the configuredparameters.
-
Constructor Details
-
AbstractTrainer
public AbstractTrainer() -
AbstractTrainer
Initializes aAbstractTrainerviaTrainingParameters.- Parameters:
trainParams- TheTrainingParametersto use.
-
-
Method Details
-
init
- Specified by:
initin interfaceTrainer- Parameters:
trainParams- TheTrainingParametersto use.reportMap- TheMapinstance used as report map.
-
getAlgorithm
- Returns:
- Retrieves the configured
TrainingParameters.ALGORITHM_PARAMvalue.
-
getCutoff
public int getCutoff()- Returns:
- Retrieves the configured
TrainingParameters.CUTOFF_PARAMvalue.
-
getIterations
public int getIterations()- Returns:
- Retrieves the configured
TrainingParameters.ITERATIONS_PARAMvalue.
-
validate
public void validate()Checks the configuredparameters. If a subclass overrides this, it should callsuper.validate();.- Throws:
IllegalArgumentException- Thrown if default training parameters are invalid.
-