POSEvaluator (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.postag, class: POSEvaluator

# Class POSEvaluator

java.lang.Object
opennlp.tools.util.eval.Evaluator<POSSample>
opennlp.tools.postag.POSEvaluator

public class POSEvaluator extends Evaluator<POSSample>
The `POSEvaluator` measures the performance of the given `POSTagger` with the provided reference `samples`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `POSEvaluator(POSTagger tagger, POSTaggerEvaluationMonitor... listeners)`
  Initializes the current instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `getWordAccuracy()`
  Accuracy defined as: `word accuracy = correctly detected tags / total words`
  `long`
  `getWordCount()`
  `String`
  `toString()`
  Represents this object as human-readable `String`.

  ### Methods inherited from class Evaluator

  `evaluate, evaluateSample`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### POSEvaluator

    public POSEvaluator(POSTagger tagger, POSTaggerEvaluationMonitor... listeners)
    Initializes the current instance.
    Parameters:
      `tagger` - The `POSTagger` to evaluate.
      `listeners` - the `evaluation listeners`.

- ## Method Details

  - ### getWordAccuracy

    public double getWordAccuracy()
    Accuracy defined as: `word accuracy = correctly detected tags / total words`
    Returns:
      Retrieves the mean word accuracy.

  - ### getWordCount

    public long getWordCount()
    Returns:
      Retrieves the total number of words considered in the evaluation.

  - ### toString

    public String toString()
    Represents this object as human-readable `String`.
    Overrides:
      `toString` in class `Object`