Class DocumentCategorizerEvaluator
java.lang.Object
opennlp.tools.util.eval.Evaluator<opennlp.tools.doccat.DocumentSample>
opennlp.tools.doccat.DocumentCategorizerEvaluator
The
DocumentCategorizerEvaluator measures the performance of
the given DocumentCategorizer with the provided reference
samples.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentCategorizerEvaluator(opennlp.tools.doccat.DocumentCategorizer categorizer, opennlp.tools.doccat.DoccatEvaluationMonitor... listeners) Initializes aDocumentCategorizerEvaluatorinstance. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccuracy = correctly categorized documents / total documentslongopennlp.tools.doccat.DocumentSampleprocessSample(opennlp.tools.doccat.DocumentSample sample) Evaluates the given referencesample.toString()Represents this object as human-readableString.Methods inherited from class Evaluator
evaluate, evaluateSample
-
Constructor Details
-
DocumentCategorizerEvaluator
public DocumentCategorizerEvaluator(opennlp.tools.doccat.DocumentCategorizer categorizer, opennlp.tools.doccat.DoccatEvaluationMonitor... listeners) Initializes aDocumentCategorizerEvaluatorinstance.- Parameters:
categorizer- theDocumentCategorizerinstance.listeners- theevaluation listeners.
-
-
Method Details
-
processSample
public opennlp.tools.doccat.DocumentSample processSample(opennlp.tools.doccat.DocumentSample sample) 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
-