Class DocumentCategorizerEvaluator

Namespace
NOpenNLP.Tools.Doccat
Assembly
NOpenNLP.Tools.dll

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

public class DocumentCategorizerEvaluator : Evaluator<DocumentSample>
Inheritance
DocumentCategorizerEvaluator
Inherited Members

Constructors

DocumentCategorizerEvaluator(IDocumentCategorizer, params IDoccatEvaluationMonitor?[]?)

Initializes the current instance.

public DocumentCategorizerEvaluator(IDocumentCategorizer categorizer, params IDoccatEvaluationMonitor?[]? listeners)

Parameters

categorizer IDocumentCategorizer

the document categorizer instance

listeners IDoccatEvaluationMonitor[]

an array of evaluation listeners

Properties

Accuracy

Retrieves the accuracy of provided IDocumentCategorizer.

accuracy = correctly categorized documents / total documents

public virtual double Accuracy { get; }

Property Value

double

DocumentCount

public virtual long DocumentCount { get; }

Property Value

long

Methods

ProcessSample(DocumentSample)

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.

protected override DocumentSample ProcessSample(DocumentSample reference)

Parameters

reference DocumentSample

the reference DocumentSample.

Returns

DocumentSample

the predicted DocumentSample.

ToString()

Represents this objects as human readable string.

public override string ToString()

Returns

string

See Also