Package opennlp.tools.parser
Class ParserCrossValidator
java.lang.Object
opennlp.tools.parser.ParserCrossValidator
Cross validator for a
Parser
.-
Constructor Summary
ConstructorDescriptionParserCrossValidator
(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors) Initializes aParserCrossValidator
instance via given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(ObjectStream<Parse> samples, int nFolds) Starts the evaluation.
-
Constructor Details
-
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 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.IllegalStateException
- Thrown if the currently activeParserType
is not supported.
-
getFMeasure
-