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 aParserCrossValidatorinstance via given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluate(ObjectStream<Parse> samples, int nFolds)Starts the evaluation.FMeasuregetFMeasure()
-
-
-
Constructor Detail
-
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 Detail
-
evaluate
public void evaluate(ObjectStream<Parse> samples, int nFolds) throws IOException
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
public FMeasure getFMeasure()
-
-