Package opennlp.tools.tokenize
Class TokenizerCrossValidator
java.lang.Object
opennlp.tools.tokenize.TokenizerCrossValidator
A cross validator for
tokenizers
.-
Constructor Summary
ConstructorDescriptionTokenizerCrossValidator
(TrainingParameters params, TokenizerFactory factory, TokenizerEvaluationMonitor... listeners) Creates aTokenizerCrossValidator
using the givenTokenizerFactory
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(ObjectStream<TokenSample> samples, int nFolds) Starts the evaluation.
-
Constructor Details
-
TokenizerCrossValidator
public TokenizerCrossValidator(TrainingParameters params, TokenizerFactory factory, TokenizerEvaluationMonitor... listeners) Creates aTokenizerCrossValidator
using the givenTokenizerFactory
.- Parameters:
params
- TheTrainingParameters
for the context of cross validation.factory
- TheTokenizerFactory
to be used.listeners
- Theevaluation listeners
.
-
-
Method Details
-
evaluate
Starts the evaluation.- 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 during evaluation.
-
getFMeasure
-