public interface DocumentCategorizer
Modifier and Type | Method and Description |
---|---|
double[] |
categorize(String[] text)
Categorizes the given text, provided in separate tokens.
|
double[] |
categorize(String[] text,
Map<String,Object> extraInformation)
Categorize the given text provided as tokens along with
the provided extra information
|
String |
getAllResults(double[] results)
get the name of the category associated with the given probabilties
|
String |
getBestCategory(double[] outcome)
get the best category from previously generated outcome probabilities
|
String |
getCategory(int index)
get the category at a given index
|
int |
getIndex(String category)
get the index of a certain category
|
int |
getNumberOfCategories()
get the number of categories
|
Map<String,Double> |
scoreMap(String[] text)
Returns a map in which the key is the category name and the value is the score
|
SortedMap<Double,Set<String>> |
sortedScoreMap(String[] text)
Get a map of the scores sorted in ascending aorder together with their associated categories.
|
double[] categorize(String[] text, Map<String,Object> extraInformation)
text
- the tokens of text to categorizeextraInformation
- extra informationdouble[] categorize(String[] text)
text
- the tokens of text to categorizeString getBestCategory(double[] outcome)
outcome
- a vector of outcome probabilitiesint getIndex(String category)
category
- the categoryString getCategory(int index)
index
- the indexint getNumberOfCategories()
String getAllResults(double[] results)
results
- the probabilities of each categoryMap<String,Double> scoreMap(String[] text)
text
- the input text to classifySortedMap<Double,Set<String>> sortedScoreMap(String[] text)
text
- the input text to classifyCopyright © 2017 The Apache Software Foundation. All rights reserved.