Package opennlp.tools.ml
Klasse TrainerFactory
java.lang.Object
opennlp.tools.ml.TrainerFactory
A factory to initialize
Trainer instances depending on a trainer type
configured via TrainingParameters.-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T> EventModelSequenceTrainer<T> getEventModelSequenceTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves anEventModelSequenceTrainerthat fits the given parameters.static EventTrainergetEventTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves anEventTrainerthat fits the given parameters.static SequenceTrainergetSequenceModelTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves aSequenceTrainerthat fits the given parameters.static TrainerFactory.TrainerTypegetTrainerType(TrainingParameters trainParams) Determines theTrainerFactory.TrainerTypebased on theTrainingParameters.ALGORITHM_PARAMvalue.static booleanisValid(TrainingParameters trainParams)
-
Konstruktordetails
-
TrainerFactory
public TrainerFactory()
-
-
Methodendetails
-
getTrainerType
Determines theTrainerFactory.TrainerTypebased on theTrainingParameters.ALGORITHM_PARAMvalue.- Parameter:
trainParams- - A mapping oftraining parameters.- Gibt zurück:
- The
TrainerFactory.TrainerTypeornullif the type couldn't be determined.
-
getSequenceModelTrainer
public static SequenceTrainer getSequenceModelTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves aSequenceTrainerthat fits the given parameters.- Parameter:
trainParams- TheTrainingParametersto check for the trainer type. Note: The entryTrainingParameters.ALGORITHM_PARAMis used to determine the type.reportMap- AMapthat shall be used during initialization of theSequenceTrainer.- Gibt zurück:
- A valid
SequenceTrainerfor the configuredtrainParams. - Löst aus:
IllegalArgumentException- Thrown if the trainer type could not be determined.
-
getEventModelSequenceTrainer
public static <T> EventModelSequenceTrainer<T> getEventModelSequenceTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves anEventModelSequenceTrainerthat fits the given parameters.- Parameter:
trainParams- TheTrainingParametersto check for the trainer type. Note: The entryTrainingParameters.ALGORITHM_PARAMis used to determine the type.reportMap- AMapthat shall be used during initialization of theEventModelSequenceTrainer.- Gibt zurück:
- A valid
EventModelSequenceTrainerfor the configuredtrainParams. - Löst aus:
IllegalArgumentException- Thrown if the trainer type could not be determined.
-
getEventTrainer
public static EventTrainer getEventTrainer(TrainingParameters trainParams, Map<String, String> reportMap) Retrieves anEventTrainerthat fits the given parameters.- Parameter:
trainParams- TheTrainingParametersto check for the trainer type. Note: The entryTrainingParameters.ALGORITHM_PARAMis used to determine the type. If the type is not defined, theGISTrainer.MAXENT_VALUEwill be used.reportMap- AMapthat shall be used during initialization of theEventTrainer.- Gibt zurück:
- A valid
EventTrainerfor the configuredtrainParams.
-
isValid
- Parameter:
trainParams- TheTrainingParametersto validate. Must not benull.- Gibt zurück:
trueif thetrainParamscould be validated,falseotherwise.
-