SDCrossValidator (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.sentdetect

## Class SDCrossValidator

- java.lang.Object
- - opennlp.tools.sentdetect.SDCrossValidator

-     public class SDCrossValidator
      extends Object

  A cross validator for the sentence detector.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SDCrossValidator(String languageCode)` Deprecated. use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` instead and pass in a TrainingParameters object.
    `SDCrossValidator(String languageCode, TrainingParameters params)` Deprecated. Use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` and pass in a `SentenceDetectorFactory`.
    `SDCrossValidator(String languageCode, TrainingParameters params, SentenceDetectorEvaluationMonitor... listeners)` Deprecated. use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` instead and pass in a TrainingParameters object.
    `SDCrossValidator(String languageCode, TrainingParameters params, SentenceDetectorFactory sdFactory, SentenceDetectorEvaluationMonitor... listeners)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `evaluate(ObjectStream<SentenceSample> 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 Detail

    - #### SDCrossValidator

          public SDCrossValidator(String languageCode,
                                  TrainingParameters params,
                                  SentenceDetectorFactory sdFactory,
                                  SentenceDetectorEvaluationMonitor... listeners)

    - #### SDCrossValidator

          public SDCrossValidator(String languageCode,
                                  TrainingParameters params)

      Deprecated. Use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` and pass in a `SentenceDetectorFactory`.

    - #### SDCrossValidator

          public SDCrossValidator(String languageCode,
                                  TrainingParameters params,
                                  SentenceDetectorEvaluationMonitor... listeners)

      Deprecated. use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` instead and pass in a TrainingParameters object.

    - #### SDCrossValidator

          public SDCrossValidator(String languageCode)

      Deprecated. use `SDCrossValidator(String, TrainingParameters, SentenceDetectorFactory, SentenceDetectorEvaluationMonitor...)` instead and pass in a TrainingParameters object.

  - ### Method Detail

    - #### evaluate

          public void evaluate(ObjectStream<SentenceSample> samples,
                               int nFolds)
                        throws IOException

      Starts the evaluation.
      Parameters:
        `samples` - the data to train and test
        `nFolds` - number of folds
      Throws:
        `IOException`

    - #### getFMeasure

          public FMeasure getFMeasure()

Copyright © 2026 The Apache Software Foundation. All rights reserved.