Class TokenNameFinderCrossValidator
java.lang.Object
opennlp.tools.namefind.TokenNameFinderCrossValidator
Cross validator for
TokenNameFinder.-
Constructor Summary
ConstructorsConstructorDescriptionTokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String, Object> resources, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters.TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, byte[] featureGeneratorBytes, Map<String, Object> resources, opennlp.tools.util.SequenceCodec<String> codec, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters.TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, TokenNameFinderFactory factory, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample> samples, int nFolds) Starts the evaluation.opennlp.tools.util.eval.FMeasure
-
Constructor Details
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, byte[] featureGeneratorBytes, Map<String, Object> resources, opennlp.tools.util.SequenceCodec<String> codec, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.params- TheTrainingParametersfor the context of cross validation.featureGeneratorBytes- Thebyte[]representing the feature generator descriptor.resources- Additional resources in a mapping.codec- TheSequenceCodecto use.listeners- theevaluation listeners.
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String, Object> resources, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.featureGeneratorBytes- Thebyte[]representing the feature generator descriptor.resources- Additional resources in a mapping.listeners- theevaluation listeners.
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, TokenNameFinderFactory factory, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.params- TheTrainingParametersfor the context of cross validation.factory- TheTokenNameFinderFactoryfor creating related objects.listeners- theevaluation listeners.
-
-
Method Details
-
evaluate
public void evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample> samples, int nFolds) throws IOException Starts the evaluation.Note: The name samples need to be grouped on a document basis.
- Parameters:
samples- TheObjectStreamofsamplesto train and test with.nFolds- Number of folds. It must be greater than zero.- Throws:
IOException- Thrown if IO errors occurred.
-
getFMeasure
public opennlp.tools.util.eval.FMeasure getFMeasure()
-