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, opennlp.tools.util.TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String,Object> resources, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners)`
  Initializes a `TokenNameFinderCrossValidator` with the given parameters.
  `TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, byte[] featureGeneratorBytes, Map<String,Object> resources, opennlp.tools.util.SequenceCodec<String> codec, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners)`
  Initializes a `TokenNameFinderCrossValidator` with the given parameters.
  `TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, TokenNameFinderFactory factory, opennlp.tools.namefind.TokenNameFinderEvaluationMonitor... listeners)`
  Initializes a `TokenNameFinderCrossValidator` with the given parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample> 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

  - ### TokenNameFinderCrossValidator

    public TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters params, byte[] featureGeneratorBytes, Map<String,Object> resources, opennlp.tools.util.SequenceCodec<String> codec, opennlp.tools.namefind.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.
      `featureGeneratorBytes` - The `byte[]` representing the feature generator descriptor.
      `resources` - Additional resources in a mapping.
      `codec` - The `SequenceCodec` to use.
      `listeners` - the `evaluation listeners`.

  - ### TokenNameFinderCrossValidator

    public TokenNameFinderCrossValidator(String languageCode, String type, opennlp.tools.util.TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String,Object> resources, opennlp.tools.namefind.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, opennlp.tools.util.TrainingParameters params, TokenNameFinderFactory factory, opennlp.tools.namefind.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 Details

  - ### evaluate

    public void evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.namefind.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 opennlp.tools.util.eval.FMeasure getFMeasure()