Package opennlp.tools.doccat
Class DocumentCategorizerEvaluator
The
DocumentCategorizerEvaluator
measures the performance of
the given DocumentCategorizer
with the provided reference
samples
.- See Also:
-
Constructor Summary
ConstructorDescriptionDocumentCategorizerEvaluator
(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners) Initializes aDocumentCategorizerEvaluator
instance. -
Method Summary
Modifier and TypeMethodDescriptiondouble
accuracy = correctly categorized documents / total documents
long
processSample
(DocumentSample sample) Evaluates the given referencesample
.toString()
Represents this object as human-readableString
.Methods inherited from class opennlp.tools.util.eval.Evaluator
evaluate, evaluateSample
-
Constructor Details
-
DocumentCategorizerEvaluator
public DocumentCategorizerEvaluator(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners) Initializes aDocumentCategorizerEvaluator
instance.- Parameters:
categorizer
- theDocumentCategorizer
instance.listeners
- theevaluation listeners
.
-
-
Method Details
-
processSample
Evaluates the given referencesample
.This is done by categorizing the document from the provided
DocumentSample
. The detected category is then used to calculate and update the score.- Parameters:
sample
- The referenceTokenSample
.- Returns:
- The processed
TokenSample
.
-
getAccuracy
public double getAccuracy()accuracy = correctly categorized documents / total documents
- Returns:
- Retrieves the accuracy of provided
DocumentCategorizer
.
-
getDocumentCount
public long getDocumentCount() -
toString
Represents this object as human-readableString
.
-