public class DocumentCategorizerEvaluator extends Object
DocumentCategorizerEvaluator
measures the performance of
the given DocumentCategorizer
with the provided reference
DocumentSample
s.DocumentCategorizer
,
DocumentSample
Constructor and Description |
---|
DocumentCategorizerEvaluator(DocumentCategorizer categorizer)
Initializes the current instance.
|
Modifier and Type | Method and Description |
---|---|
void |
evaluate(Iterator<DocumentSample> samples)
Reads all
DocumentSample objects from the stream
and evaluates each DocumentSample object with
evaluteSample(DocumentSample) method. |
void |
evaluteSample(DocumentSample sample)
Evaluates the given reference
DocumentSample object. |
double |
getAccuracy()
Retrieves the accuracy of provided
DocumentCategorizer . |
String |
toString()
Represents this objects as human readable
String . |
public DocumentCategorizerEvaluator(DocumentCategorizer categorizer)
categorizer
- public void evaluteSample(DocumentSample sample)
DocumentSample
object.
This is done by categorizing the document from the provided
DocumentSample
. The detected category is then used
to calculate and update the score.sample
- the reference TokenSample
.public void evaluate(Iterator<DocumentSample> samples)
DocumentSample
objects from the stream
and evaluates each DocumentSample
object with
evaluteSample(DocumentSample)
method.samples
- the stream of reference POSSample
which
should be evaluated.public double getAccuracy()
DocumentCategorizer
.
accuracy = correctly categorized documents / total documentsCopyright © 2015 The Apache Software Foundation. All rights reserved.