Interface IDocumentCategorizer
Interface for classes which categorize documents.
public interface IDocumentCategorizer
Properties
NumberOfCategories
Gets the number of categories
int NumberOfCategories { get; }
Property Value
Methods
Categorize(string[])
Categorizes the given text, provided in separate tokens.
double[] Categorize(string[] text)
Parameters
textstring[]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
textstring[]the tokens of text to categorize
extraInformationIDictionary<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
resultsdouble[]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
outcomedouble[]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
indexintthe index
Returns
- string
a category
GetIndex(string)
Gets the index of a certain category
int GetIndex(string category)
Parameters
categorystringthe 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
textstring[]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
textstring[]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.