ParserCrossValidator (Apache OpenNLP :: Tools 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.parser, class: ParserCrossValidator

Package opennlp.tools.parser

# Class ParserCrossValidator

java.lang.Object
opennlp.tools.parser.ParserCrossValidator

public class ParserCrossValidator extends Object
Cross validator for a `Parser`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParserCrossValidator(String languageCode, opennlp.tools.util.TrainingParameters params, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserType parserType, opennlp.tools.parser.ParserEvaluationMonitor... monitors)`
  Initializes a `ParserCrossValidator` instance via given parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> samples, int nFolds)`
  Starts the evaluation.
  `opennlp.tools.util.eval.FMeasure`
  `getFMeasure()`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ParserCrossValidator

    public ParserCrossValidator(String languageCode, opennlp.tools.util.TrainingParameters params, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserType parserType, opennlp.tools.parser.ParserEvaluationMonitor... monitors)
    Initializes a `ParserCrossValidator` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `params` - The `TrainingParameters` for the context of cross validation.
      `rules` - The `HeadRules` for the context of cross validation.
      `parserType` - The `ParserType` for the context of cross validation.
      `monitors` - the `evaluation listeners`.

- ## Method Details

  - ### evaluate

    public void evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> samples, int nFolds) throws IOException
    Starts the evaluation.
    Parameters:
      `samples` - The `ObjectStream` of `samples` 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 active `ParserType` is not supported.

  - ### getFMeasure

    public opennlp.tools.util.eval.FMeasure getFMeasure()