Package opennlp.tools.parser
Class ParserCrossValidator
- java.lang.Object
-
- opennlp.tools.parser.ParserCrossValidator
-
-
Constructor Summary
Constructors Constructor Description ParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors)
Initializes aParserCrossValidator
instance via given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evaluate(ObjectStream<Parse> samples, int nFolds)
Starts the evaluation.FMeasure
getFMeasure()
-
-
-
Constructor Detail
-
ParserCrossValidator
public ParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors)
Initializes aParserCrossValidator
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.params
- TheTrainingParameters
for the context of cross validation.rules
- TheHeadRules
for the context of cross validation.parserType
- TheParserType
for the context of cross validation.monitors
- theevaluation listeners
.
-
-
Method Detail
-
evaluate
public void evaluate(ObjectStream<Parse> 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.IllegalStateException
- Thrown if the currently activeParserType
is not supported.
-
getFMeasure
public FMeasure getFMeasure()
-
-