Evaluator (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.util.eval, class: Evaluator

Package opennlp.tools.util.eval

# Class Evaluator<T>

java.lang.Object
opennlp.tools.util.eval.Evaluator<T>

Direct Known Subclasses:
  `ChunkerEvaluator`, `DocumentCategorizerEvaluator`, `LanguageDetectorEvaluator`, `LemmatizerEvaluator`, `POSEvaluator`, `SentenceDetectorEvaluator`, `SentimentEvaluator`, `TokenizerEvaluator`, `TokenNameFinderEvaluator`

public abstract class Evaluator<T> extends Object
An abstract base class for evaluators. Evaluation results are the arithmetic mean of the scores calculated for each reference sample.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Evaluator(opennlp.tools.util.eval.EvaluationMonitor<T>... aListeners)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(opennlp.tools.util.ObjectStream<T> samples)`
  Reads all `sample objects` and evaluates each instance via the `evaluateSample(Object)` method.
  `void`
  `evaluateSample(T sample)`
  Evaluates the given reference object.

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

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

- ## Constructor Details

  - ### Evaluator

    @SafeVarargs public Evaluator(opennlp.tools.util.eval.EvaluationMonitor<T>... aListeners)

- ## Method Details

  - ### evaluateSample

    public void evaluateSample(T sample)
    Evaluates the given reference object. The default implementation calls `processSample(Object)`

    note: this method will be changed to private in the future. Implementations should override `processSample(Object)` instead. If this method is overridden, the implementation has to update the score after every invocation.

    Parameters:
      `sample` - A `sample` to be evaluated.

  - ### evaluate

    public void evaluate(opennlp.tools.util.ObjectStream<T> samples) throws IOException
    Reads all `sample objects` and evaluates each instance via the `evaluateSample(Object)` method.
    Parameters:
      `samples` - The `stream` of reference which shall be evaluated.
    Throws:
      `IOException` - Thrown if IO errors occurred.