Package opennlp.tools.doccat
Class DocumentCategorizerEvaluator
- java.lang.Object
-
- opennlp.tools.util.eval.Evaluator<DocumentSample>
-
- opennlp.tools.doccat.DocumentCategorizerEvaluator
-
public class DocumentCategorizerEvaluator extends Evaluator<DocumentSample>
TheDocumentCategorizerEvaluatormeasures the performance of the givenDocumentCategorizerwith the provided referenceDocumentSamples.- See Also:
DocumentCategorizer,DocumentSample
-
-
Constructor Summary
Constructors Constructor Description DocumentCategorizerEvaluator(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners)Initializes the current instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetAccuracy()Retrieves the accuracy of providedDocumentCategorizer.longgetDocumentCount()DocumentSampleprocessSample(DocumentSample sample)Evaluates the given referenceDocumentSampleobject.StringtoString()Represents this objects as human readableString.-
Methods inherited from class opennlp.tools.util.eval.Evaluator
evaluate, evaluateSample
-
-
-
-
Constructor Detail
-
DocumentCategorizerEvaluator
public DocumentCategorizerEvaluator(DocumentCategorizer categorizer, DoccatEvaluationMonitor... listeners)
Initializes the current instance.- Parameters:
categorizer- the document categorizer instance
-
-
Method Detail
-
processSample
public DocumentSample processSample(DocumentSample sample)
Evaluates the given referenceDocumentSampleobject. This is done by categorizing the document from the providedDocumentSample. The detected category is then used to calculate and update the score.- Parameters:
sample- the referenceTokenSample.
-
getAccuracy
public double getAccuracy()
Retrieves the accuracy of providedDocumentCategorizer. accuracy = correctly categorized documents / total documents- Returns:
- the accuracy
-
getDocumentCount
public long getDocumentCount()
-
-