Class LanguageDetectorEvaluator

Namespace
NOpenNLP.Tools.Langdetect
Assembly
NOpenNLP.Tools.dll

The LanguageDetectorEvaluator measures the performance of the given ILanguageDetector with the provided reference LanguageSamples.

public class LanguageDetectorEvaluator : Evaluator<LanguageSample>
Inheritance
LanguageDetectorEvaluator
Inherited Members

Constructors

LanguageDetectorEvaluator(ILanguageDetector, params ILanguageDetectorEvaluationMonitor?[]?)

Initializes the current instance.

public LanguageDetectorEvaluator(ILanguageDetector langDetect, params ILanguageDetectorEvaluationMonitor?[]? listeners)

Parameters

langDetect ILanguageDetector

the language detector instance

listeners ILanguageDetectorEvaluationMonitor[]

an array of evaluation listeners

Properties

Accuracy

Retrieves the accuracy of the provided ILanguageDetector.

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(LanguageSample)

Evaluates the given reference LanguageSample object.

This is done by categorizing the document from the provided LanguageSample. The detected language is then used to calculate and update the score.

protected override LanguageSample ProcessSample(LanguageSample reference)

Parameters

reference LanguageSample

the reference LanguageSample.

Returns

LanguageSample

the predicted LanguageSample.

ToString()

Represents this objects as human readable string.

public override string ToString()

Returns

string

See Also