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

opennlp.tools.lemmatizer

## Class LemmatizerEvaluator

- java.lang.Object
- - opennlp.tools.util.eval.Evaluator<LemmaSample>
  - - opennlp.tools.lemmatizer.LemmatizerEvaluator

-     public class LemmatizerEvaluator
      extends Evaluator<LemmaSample>

  The `LemmatizerEvaluator` measures the performance of the given `Lemmatizer` with the provided reference `LemmaSample`s.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LemmatizerEvaluator(Lemmatizer aLemmatizer, LemmatizerEvaluationMonitor... listeners)` Initializes the current instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getWordAccuracy()` Retrieves the word accuracy.
    `long` | `getWordCount()` Retrieves the total number of words considered in the evaluation.
    `String` | `toString()` Represents this objects as human readable `String`.

    - ### Methods inherited from class opennlp.tools.util.eval.Evaluator

      `evaluate, evaluateSample`

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

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

- - ### Constructor Detail

    - #### LemmatizerEvaluator

          public LemmatizerEvaluator(Lemmatizer aLemmatizer,
                                     LemmatizerEvaluationMonitor... listeners)

      Initializes the current instance.
      Parameters:
        `aLemmatizer` - a lemmatizer
        `listeners` - an array of evaluation listeners

  - ### Method Detail

    - #### getWordAccuracy

          public double getWordAccuracy()

      Retrieves the word accuracy. This is defined as: word accuracy = correctly detected tags / total words
      Returns:
        the word accuracy

    - #### getWordCount

          public long getWordCount()

      Retrieves the total number of words considered in the evaluation.
      Returns:
        the word count

    - #### toString

          public String toString()

      Represents this objects as human readable `String`.
      Overrides:
        `toString` in class `Object`

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