Package opennlp.tools.doccat
Class DocumentCategorizerEvaluator
The
DocumentCategorizerEvaluator measures the performance of
the given DocumentCategorizer with the provided reference
samples.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentCategorizerEvaluator(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners) Initializes aDocumentCategorizerEvaluatorinstance. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccuracy = correctly categorized documents / total documentslongprocessSample(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 aDocumentCategorizerEvaluatorinstance.- Parameters:
categorizer- theDocumentCategorizerinstance.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.
-