Interface IDocumentCategorizer

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

Interface for classes which categorize documents.

public interface IDocumentCategorizer

Properties

NumberOfCategories

Gets the number of categories

int NumberOfCategories { get; }

Property Value

int

Methods

Categorize(string[])

Categorizes the given text, provided in separate tokens.

double[] Categorize(string[] text)

Parameters

text string[]

the tokens of text to categorize

Returns

double[]

per category probabilities

Categorize(string[], IDictionary<string, object>)

Categorize the given text provided as tokens along with the provided extra information

double[] Categorize(string[] text, IDictionary<string, object> extraInformation)

Parameters

text string[]

the tokens of text to categorize

extraInformation IDictionary<string, object>

extra information

Returns

double[]

per category probabilities

GetAllResults(double[])

Gets the name of the category associated with the given probabilities

string GetAllResults(double[] results)

Parameters

results double[]

the probabilities of each category

Returns

string

the name of the outcome

GetBestCategory(double[])

Gets the best category from previously generated outcome probabilities

string GetBestCategory(double[] outcome)

Parameters

outcome double[]

a vector of outcome probabilities

Returns

string

the best category string

GetCategory(int)

Gets the category at a given index

string GetCategory(int index)

Parameters

index int

the index

Returns

string

a category

GetIndex(string)

Gets the index of a certain category

int GetIndex(string category)

Parameters

category string

the category

Returns

int

an index

ScoreMap(string[])

Returns a map in which the key is the category name and the value is the score

IDictionary<string, double> ScoreMap(string[] text)

Parameters

text string[]

the input text to classify

Returns

IDictionary<string, double>

a map with the category as a key and the score as the value.

SortedScoreMap(string[])

Gets a map of the scores sorted in ascending order together with their associated categories. Many categories can have the same score, hence the set as value

SortedDictionary<double, ISet<string>> SortedScoreMap(string[] text)

Parameters

text string[]

the input text to classify

Returns

SortedDictionary<double, ISet<string>>

a map with the score as a key. The value is a set of categories with the score.