Class TrainingParameters
java.lang.Object
opennlp.tools.util.TrainingParameters
- All Implemented Interfaces:
opennlp.tools.util.Parameters
Declares and handles default parameters used for or during training models.
-
Field Summary
Fields inherited from interface opennlp.tools.util.Parameters
ALGORITHM_DEFAULT_VALUE, ALGORITHM_PARAM, CUTOFF_DEFAULT_VALUE, CUTOFF_PARAM, ITERATIONS_DEFAULT_VALUE, ITERATIONS_PARAM, THREADS_PARAM, TRAINER_TYPE_PARAM -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor to create a defaultTrainingParametersinstance.InputStreambased constructor that reads inTrainingParameters.TrainingParameters(Map<String, Object> map) Key-value based constructor to apply aMapbased configuration initialization.TrainingParameters(TrainingParameters trainingParameters) Copy constructor to hand over the config of existingTrainingParameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic TrainingParametersbooleangetBooleanParameter(String key, boolean defaultValue) booleangetBooleanParameter(String namespace, String key, boolean defaultValue) doublegetDoubleParameter(String key, double defaultValue) doublegetDoubleParameter(String namespace, String key, double defaultValue) intgetIntParameter(String key, int defaultValue) intgetIntParameter(String namespace, String key, int defaultValue) getObjectSettings(String namespace) getParameters(String namespace) getStringParameter(String key, String defaultValue) getStringParameter(String namespace, String key, String defaultValue) voidvoidvoidvoidvoidvoidvoidvoidvoidputIfAbsent(String key, boolean value) voidputIfAbsent(String key, double value) voidputIfAbsent(String key, int value) voidputIfAbsent(String key, String value) voidputIfAbsent(String namespace, String key, boolean value) voidputIfAbsent(String namespace, String key, double value) voidputIfAbsent(String namespace, String key, int value) voidputIfAbsent(String namespace, String key, String value) voidserialize(OutputStream out) static TrainingParameters
-
Constructor Details
-
TrainingParameters
public TrainingParameters()No-arg constructor to create a defaultTrainingParametersinstance. -
TrainingParameters
Copy constructor to hand over the config of existingTrainingParameters. -
TrainingParameters
-
TrainingParameters
InputStreambased constructor that reads inTrainingParameters.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
algorithm
-
algorithm
- Specified by:
algorithmin interfaceopennlp.tools.util.Parameters
-
getObjectSettings
-
getObjectSettings
-
getParameters
- Parameters:
namespace- The name space to filter or narrow the search space. May benull.- Returns:
- Retrieves
TrainingParameterswhich can be passed to the train and validate methods.
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceopennlp.tools.util.Parameters
-
putIfAbsent
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceopennlp.tools.util.Parameters
-
putIfAbsent
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceopennlp.tools.util.Parameters
-
put
-
put
-
put
-
put
- Specified by:
putin interfaceopennlp.tools.util.Parameters
-
put
-
put
- Specified by:
putin interfaceopennlp.tools.util.Parameters
-
put
-
put
- Specified by:
putin interfaceopennlp.tools.util.Parameters
-
serialize
- Specified by:
serializein interfaceopennlp.tools.util.Parameters- Throws:
IOException
-
getStringParameter
-
getStringParameter
-
getIntParameter
- Specified by:
getIntParameterin interfaceopennlp.tools.util.Parameters
-
getIntParameter
-
getDoubleParameter
- Specified by:
getDoubleParameterin interfaceopennlp.tools.util.Parameters
-
getDoubleParameter
-
getBooleanParameter
- Specified by:
getBooleanParameterin interfaceopennlp.tools.util.Parameters
-
getBooleanParameter
-
defaultParams
- Returns:
- Retrieves a new
instanceinitialized with default values.
-
setParams
-