Package opennlp.tools.namefind
Class TokenNameFinderCrossValidator
java.lang.Object
opennlp.tools.namefind.TokenNameFinderCrossValidator
Cross validator for
TokenNameFinder
.-
Constructor Summary
ConstructorDescriptionTokenNameFinderCrossValidator
(String languageCode, String type, TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String, Object> resources, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters.TokenNameFinderCrossValidator
(String languageCode, String type, TrainingParameters params, byte[] featureGeneratorBytes, Map<String, Object> resources, SequenceCodec<String> codec, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters.TokenNameFinderCrossValidator
(String languageCode, String type, TrainingParameters params, TokenNameFinderFactory factory, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(ObjectStream<NameSample> samples, int nFolds) Starts the evaluation.
-
Constructor Details
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters params, byte[] featureGeneratorBytes, Map<String, Object> resources, SequenceCodec<String> codec, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters.- Parameters:
languageCode
- The ISO conform language code.type
-null
or an override type for all types in the training data.featureGeneratorBytes
- Thebyte[]
representing the feature generator descriptor.resources
- Additional resources in a mapping.codec
- TheSequenceCodec
to use.params
- TheTrainingParameters
for the context of cross validation.listeners
- theevaluation listeners
.
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String, Object> resources, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters.- Parameters:
languageCode
- The ISO conform language code.type
-null
or 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, TrainingParameters params, TokenNameFinderFactory factory, TokenNameFinderEvaluationMonitor... listeners) Initializes aTokenNameFinderCrossValidator
with the given parameters.- Parameters:
languageCode
- The ISO conform language code.type
-null
or an override type for all types in the training data.params
- TheTrainingParameters
for the context of cross validation.factory
- TheTokenNameFinderFactory
for creating related objects.listeners
- theevaluation listeners
.
-
-
Method Details
-
evaluate
Starts the evaluation.Note: The name samples need to be grouped on a document basis.
- Parameters:
samples
- TheObjectStream
ofsamples
to train and test with.nFolds
- Number of folds. It must be greater than zero.- Throws:
IOException
- Thrown if IO errors occurred.
-
getFMeasure
-