Package opennlp.tools.ml
Class AbstractTrainer
java.lang.Object
opennlp.tools.ml.AbstractTrainer
- All Implemented Interfaces:
Trainer
- Direct Known Subclasses:
AbstractEventModelSequenceTrainer
,AbstractEventTrainer
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractTrainer
(TrainingParameters trainParams) Initializes aAbstractTrainer
viaTrainingParameters
. -
Method Summary
Modifier and TypeMethodDescriptionint
int
void
init
(TrainingParameters trainParams, Map<String, String> reportMap) void
validate()
Checks the configuredparameters
.
-
Field Details
-
ALGORITHM_PARAM
- See Also:
-
TRAINER_TYPE_PARAM
- See Also:
-
CUTOFF_PARAM
- See Also:
-
CUTOFF_DEFAULT
public static final int CUTOFF_DEFAULT- See Also:
-
ITERATIONS_PARAM
- See Also:
-
ITERATIONS_DEFAULT
public static final int ITERATIONS_DEFAULT- See Also:
-
-
Constructor Details
-
AbstractTrainer
public AbstractTrainer() -
AbstractTrainer
Initializes aAbstractTrainer
viaTrainingParameters
.- Parameters:
trainParams
- TheTrainingParameters
to use.
-
-
Method Details
-
init
- Specified by:
init
in interfaceTrainer
- Parameters:
trainParams
- TheTrainingParameters
to use.reportMap
- TheMap
instance used as report map.
-
getAlgorithm
- Returns:
- Retrieves the configured
ALGORITHM_PARAM
value.
-
getCutoff
public int getCutoff()- Returns:
- Retrieves the configured
CUTOFF_PARAM
value.
-
getIterations
public int getIterations()- Returns:
- Retrieves the configured
ITERATIONS_PARAM
value.
-
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.
-