Package opennlp.tools.postag
Class POSEvaluator
- java.lang.Object
-
- opennlp.tools.util.eval.Evaluator<POSSample>
-
- opennlp.tools.postag.POSEvaluator
-
public class POSEvaluator extends Evaluator<POSSample>
ThePOSEvaluator
measures the performance of the givenPOSTagger
with the provided referencePOSSample
s.
-
-
Constructor Summary
Constructors Constructor Description POSEvaluator(POSTagger tagger, POSTaggerEvaluationMonitor... listeners)
Initializes the current instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 readableString
.-
Methods inherited from class opennlp.tools.util.eval.Evaluator
evaluate, evaluateSample
-
-
-
-
Constructor Detail
-
POSEvaluator
public POSEvaluator(POSTagger tagger, POSTaggerEvaluationMonitor... listeners)
Initializes the current instance.- Parameters:
tagger
-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
-
-