Package opennlp.tools.tokenize
Class TokenizerCrossValidator
- java.lang.Object
-
- opennlp.tools.tokenize.TokenizerCrossValidator
-
public class TokenizerCrossValidator extends Object
A cross validator fortokenizers
.
-
-
Constructor Summary
Constructors Constructor Description TokenizerCrossValidator(TrainingParameters params, TokenizerFactory factory, TokenizerEvaluationMonitor... listeners)
Creates aTokenizerCrossValidator
using the givenTokenizerFactory
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evaluate(ObjectStream<TokenSample> samples, int nFolds)
Starts the evaluation.FMeasure
getFMeasure()
-
-
-
Constructor Detail
-
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 Detail
-
evaluate
public void evaluate(ObjectStream<TokenSample> samples, int nFolds) throws IOException
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
public FMeasure getFMeasure()
-
-