public class DocumentCategorizerEvaluator extends Evaluator<DocumentSample>
DocumentCategorizerEvaluator measures the performance of
the given DocumentCategorizer with the provided reference
DocumentSamples.DocumentCategorizer,
DocumentSample| Constructor and Description |
|---|
DocumentCategorizerEvaluator(DocumentCategorizer categorizer,
DoccatEvaluationMonitor... listeners)
Initializes the current instance.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getAccuracy()
Retrieves the accuracy of provided
DocumentCategorizer. |
long |
getDocumentCount() |
DocumentSample |
processSample(DocumentSample sample)
Evaluates the given reference
DocumentSample object. |
String |
toString()
Represents this objects as human readable
String. |
evaluate, evaluateSamplepublic DocumentCategorizerEvaluator(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners)
categorizer - public DocumentSample processSample(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 double getAccuracy()
DocumentCategorizer.
accuracy = correctly categorized documents / total documentspublic long getDocumentCount()
Copyright © 2015 The Apache Software Foundation. All rights reserved.