Class POSEvaluator


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

    • tagger

      private final POSTagger tagger
    • wordAccuracy

      private final Mean wordAccuracy
  • Constructor Details

  • Method Details

    • processSample

      protected POSSample processSample(POSSample reference)
      Evaluates the given reference POSSample object. This is done by tagging the sentence from the reference POSSample with the POSTagger. The tags are then used to update the word accuracy score.
      Specified by:
      processSample in class Evaluator<POSSample>
      Parameters:
      reference - The POSSample to process.
      Returns:
      The predicted POSSample.
    • 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