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>
TheDocumentCategorizerEvaluator
measures the performance of the givenDocumentCategorizer
with the provided referenceDocumentSample
s.- 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 double
getAccuracy()
Retrieves the accuracy of providedDocumentCategorizer
.long
getDocumentCount()
DocumentSample
processSample(DocumentSample sample)
Evaluates the given referenceDocumentSample
object.String
toString()
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 referenceDocumentSample
object. 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()
-
-