opennlp.tools.doccat
Class DocumentCategorizerEvaluator

java.lang.Object
  extended by opennlp.tools.doccat.DocumentCategorizerEvaluator

public class DocumentCategorizerEvaluator
extends Object

The DocumentCategorizerEvaluator measures the performance of the given DocumentCategorizer with the provided reference DocumentSamples.

See Also:
DocumentCategorizer, DocumentSample

Constructor Summary
DocumentCategorizerEvaluator(DocumentCategorizer categorizer)
          Initializes the current instance.
 
Method Summary
 void evaluate(Iterator<DocumentSample> samples)
          Reads all DocumentSample objects from the stream and evaluates each DocumentSample object with #evaluateSample(POSSample) method.
 void evaluteSample(DocumentSample sample)
          Evaluates the given reference DocumentSample object.
 double getAccuracy()
          Retrieves the accuracy of provided DocumentCategorizer.
 String toString()
          Represents this objects as human readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentCategorizerEvaluator

public DocumentCategorizerEvaluator(DocumentCategorizer categorizer)
Initializes the current instance.

Parameters:
categorizer -
Method Detail

evaluteSample

public void evaluteSample(DocumentSample sample)
Evaluates the given reference DocumentSample object. This is done by categorizing the document from the provided DocumentSample. The detected category is then used to calculate and update the score.

Parameters:
reference - the reference TokenSample.

evaluate

public void evaluate(Iterator<DocumentSample> samples)
Reads all DocumentSample objects from the stream and evaluates each DocumentSample object with #evaluateSample(POSSample) method.

Parameters:
samples - the stream of reference POSSample which should be evaluated.

getAccuracy

public double getAccuracy()
Retrieves the accuracy of provided DocumentCategorizer. accuracy = correctly categorized documents / total documents

Returns:
the accuracy

toString

public String toString()
Represents this objects as human readable String.

Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.