Package opennlp.tools.namefind

## Class TokenNameFinderCrossValidator

- java.lang.Object
- - opennlp.tools.namefind.TokenNameFinderCrossValidator

-     public class TokenNameFinderCrossValidator
      extends Object

  Cross validator for `TokenNameFinder`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TokenNameFinderCrossValidator​(String languageCode, String type, TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String,​Object> resources, TokenNameFinderEvaluationMonitor... listeners)` | Initializes a `TokenNameFinderCrossValidator` with the given parameters.
    `TokenNameFinderCrossValidator​(String languageCode, String type, TrainingParameters params, byte[] featureGeneratorBytes, Map<String,​Object> resources, SequenceCodec<String> codec, TokenNameFinderEvaluationMonitor... listeners)` | Initializes a `TokenNameFinderCrossValidator` with the given parameters.
    `TokenNameFinderCrossValidator​(String languageCode, String type, TrainingParameters params, TokenNameFinderFactory factory, TokenNameFinderEvaluationMonitor... listeners)` | Initializes a `TokenNameFinderCrossValidator` with the given parameters.

  - ### Method Summary

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

    - #### TokenNameFinderCrossValidator

          public TokenNameFinderCrossValidator​(String languageCode,
                                               String type,
                                               TrainingParameters params,
                                               byte[] featureGeneratorBytes,
                                               Map<String,​Object> resources,
                                               SequenceCodec<String> codec,
                                               TokenNameFinderEvaluationMonitor... listeners)

      Initializes a `TokenNameFinderCrossValidator` with the given parameters.
      Parameters:
        `languageCode` - The ISO conform language code.
        `type` - `null` or an override type for all types in the training data.
        `featureGeneratorBytes` - The `byte[]` representing the feature generator descriptor.
        `resources` - Additional resources in a mapping.
        `codec` - The `SequenceCodec` to use.
        `params` - The `TrainingParameters` for the context of cross validation.
        `listeners` - the `evaluation listeners`.

    - #### TokenNameFinderCrossValidator

          public TokenNameFinderCrossValidator​(String languageCode,
                                               String type,
                                               TrainingParameters trainParams,
                                               byte[] featureGeneratorBytes,
                                               Map<String,​Object> resources,
                                               TokenNameFinderEvaluationMonitor... listeners)

      Initializes a `TokenNameFinderCrossValidator` with the given parameters.
      Parameters:
        `languageCode` - The ISO conform language code.
        `type` - `null` or an override type for all types in the training data.
        `featureGeneratorBytes` - The `byte[]` representing the feature generator descriptor.
        `resources` - Additional resources in a mapping.
        `listeners` - the `evaluation listeners`.

    - #### TokenNameFinderCrossValidator

          public TokenNameFinderCrossValidator​(String languageCode,
                                               String type,
                                               TrainingParameters params,
                                               TokenNameFinderFactory factory,
                                               TokenNameFinderEvaluationMonitor... listeners)

      Initializes a `TokenNameFinderCrossValidator` with the given parameters.
      Parameters:
        `languageCode` - The ISO conform language code.
        `type` - `null` or an override type for all types in the training data.
        `params` - The `TrainingParameters` for the context of cross validation.
        `factory` - The `TokenNameFinderFactory` for creating related objects.
        `listeners` - the `evaluation listeners`.

  - ### Method Detail

    - #### evaluate

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

      Starts the evaluation.

      Note: The name samples need to be grouped on a document basis.

      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()