Package opennlp.tools.util.eval
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
public abstract class Evaluator<T> extends Object
An abstract base class for evaluators. Evaluation results are the arithmetic mean of the scores calculated for each reference sample.
-
-
Constructor Summary
Constructors Constructor Description Evaluator(EvaluationMonitor<T>... aListeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evaluate(ObjectStream<T> samples)
Reads allsample objects
and evaluates each instance via theevaluateSample(Object)
method.void
evaluateSample(T sample)
Evaluates the given reference object.
-
-
-
Constructor Detail
-
Evaluator
@SafeVarargs public Evaluator(EvaluationMonitor<T>... aListeners)
-
-
Method Detail
-
evaluateSample
public void evaluateSample(T sample)
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
- Asample
to be evaluated.
-
evaluate
public void evaluate(ObjectStream<T> samples) throws IOException
Reads allsample objects
and evaluates each instance via theevaluateSample(Object)
method.- Parameters:
samples
- Thestream
of reference which shall be evaluated.- Throws:
IOException
- Thrown if IO errors occurred.
-
-