Package opennlp.tools.chunker

# Class ChunkerCrossValidator

java.lang.Object
opennlp.tools.chunker.ChunkerCrossValidator

public class ChunkerCrossValidator extends Object
Cross validator for `Chunker`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChunkerCrossValidator(String languageCode, TrainingParameters params, ChunkerFactory factory, ChunkerEvaluationMonitor... listeners)`
  Initializes a `ChunkerCrossValidator` instance via given parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(ObjectStream<ChunkSample> samples, int nFolds)`
  Starts the evaluation.
  `FMeasure`
  `getFMeasure()`

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

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

- ## Constructor Details

  - ### ChunkerCrossValidator

    public ChunkerCrossValidator(String languageCode, TrainingParameters params, ChunkerFactory factory, ChunkerEvaluationMonitor... listeners)
    Initializes a `ChunkerCrossValidator` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `factory` - The `ChunkerFactory` for creating related objects.
      `params` - The `TrainingParameters` for the context of cross validation.
      `listeners` - the `evaluation listeners`.

- ## Method Details

  - ### evaluate

    public void evaluate(ObjectStream<ChunkSample> 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.

  - ### getFMeasure

    public FMeasure getFMeasure()