Package opennlp.tools.ml
Class AbstractTrainer
- java.lang.Object
-
- opennlp.tools.ml.AbstractTrainer
-
- All Implemented Interfaces:
Trainer
- Direct Known Subclasses:
AbstractEventModelSequenceTrainer
,AbstractEventTrainer
public abstract class AbstractTrainer extends Object implements Trainer
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_PARAM
static int
CUTOFF_DEFAULT
static String
CUTOFF_PARAM
static int
ITERATIONS_DEFAULT
static String
ITERATIONS_PARAM
static String
TRAINER_TYPE_PARAM
static boolean
VERBOSE_DEFAULT
static String
VERBOSE_PARAM
-
Constructor Summary
Constructors Constructor Description AbstractTrainer()
AbstractTrainer(TrainingParameters trainParams)
Initializes aAbstractTrainer
viaTrainingParameters
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getAlgorithm()
int
getCutoff()
int
getIterations()
void
init(Map<String,Object> trainParams, Map<String,String> reportMap)
Deprecated.Useinit(TrainingParameters, Map)
instead.void
init(TrainingParameters trainParams, Map<String,String> reportMap)
boolean
isValid()
Deprecated.Usevalidate()
instead.void
validate()
Checks the configuredparameters
.
-
-
-
Field Detail
-
ALGORITHM_PARAM
public static final String ALGORITHM_PARAM
- See Also:
- Constant Field Values
-
TRAINER_TYPE_PARAM
public static final String TRAINER_TYPE_PARAM
- See Also:
- Constant Field Values
-
CUTOFF_PARAM
public static final String CUTOFF_PARAM
- See Also:
- Constant Field Values
-
CUTOFF_DEFAULT
public static final int CUTOFF_DEFAULT
- See Also:
- Constant Field Values
-
ITERATIONS_PARAM
public static final String ITERATIONS_PARAM
- See Also:
- Constant Field Values
-
ITERATIONS_DEFAULT
public static final int ITERATIONS_DEFAULT
- See Also:
- Constant Field Values
-
VERBOSE_PARAM
public static final String VERBOSE_PARAM
- See Also:
- Constant Field Values
-
VERBOSE_DEFAULT
public static final boolean VERBOSE_DEFAULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractTrainer
public AbstractTrainer()
-
AbstractTrainer
public AbstractTrainer(TrainingParameters trainParams)
Initializes aAbstractTrainer
viaTrainingParameters
.- Parameters:
trainParams
- TheTrainingParameters
to use.
-
-
Method Detail
-
init
public void init(TrainingParameters trainParams, Map<String,String> reportMap)
- Specified by:
init
in interfaceTrainer
- Parameters:
trainParams
- TheTrainingParameters
to use.reportMap
- TheMap
instance used as report map.
-
init
@Deprecated public void init(Map<String,Object> trainParams, Map<String,String> reportMap)
Deprecated.Useinit(TrainingParameters, Map)
instead.
-
getAlgorithm
public String 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.
-
isValid
@Deprecated public boolean isValid()
Deprecated.Usevalidate()
instead.- Returns:
true
if the validation of the internal configuration succeeds,false
otherwise.
-
-