Package opennlp.tools.parser
Class ParserCrossValidator
java.lang.Object
opennlp.tools.parser.ParserCrossValidator
Cross validator for a
Parser.-
Constructor Summary
ConstructorsConstructorDescriptionParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors) Initializes aParserCrossValidatorinstance via given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(ObjectStream<Parse> samples, int nFolds) Starts the evaluation.
-
Constructor Details
-
ParserCrossValidator
public ParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors) Initializes aParserCrossValidatorinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.params- TheTrainingParametersfor the context of cross validation.rules- TheHeadRulesfor the context of cross validation.parserType- TheParserTypefor the context of cross validation.monitors- theevaluation listeners.
-
-
Method Details
-
evaluate
Starts the evaluation.- Parameters:
samples- TheObjectStreamofsamplesto 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 activeParserTypeis not supported.
-
getFMeasure
-