Class Evaluator<T>
java.lang.Object
opennlp.tools.util.eval.Evaluator<T>
- Direct Known Subclasses:
ChunkerEvaluator, DetokenizerEvaluator, DocumentCategorizerEvaluator, LanguageDetectorEvaluator, LemmatizerEvaluator, ParserEvaluator, POSEvaluator, SentenceDetectorEvaluator, TokenizerEvaluator, TokenNameFinderEvaluator
An abstract base class for evaluators.
Evaluation results are the arithmetic mean of the
scores calculated for each reference sample.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(ObjectStream<T> samples) Reads allsample objectsand evaluates each instance via theevaluateSample(Object)method.voidevaluateSample(T sample) Evaluates the given reference object.protected abstract TprocessSample(T reference) Evaluates the given referenceTsample object.
-
Field Details
-
listeners
-
-
Constructor Details
-
Evaluator
-
-
Method Details
-
processSample
Evaluates the given referenceTsample object.The implementation has to update the score after every invocation.
- Parameters:
reference- Areference sample.- Returns:
- The predicted
sample.
-
evaluateSample
Evaluates the given reference object. The default implementation callsprocessSample(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- Asampleto be evaluated.
-
evaluate
Reads allsample objectsand evaluates each instance via theevaluateSample(Object)method.- Parameters:
samples- Thestreamof reference which shall be evaluated.- Throws:
IOException- Thrown if IO errors occurred.
-