public class DocumentCategorizerME extends java.lang.Object implements DocumentCategorizer
DocumentCategorizer.| Constructor and Description |
|---|
DocumentCategorizerME(DoccatModel model)
Initializes the current instance with a doccat model.
|
DocumentCategorizerME(DoccatModel model,
FeatureGenerator... featureGenerators)
Deprecated.
train a
DoccatModel with a specific
DoccatFactory to customize the FeatureGenerators |
| Modifier and Type | Method and Description |
|---|---|
double[] |
categorize(java.lang.String documentText)
Categorizes the given text.
|
double[] |
categorize(java.lang.String[] text)
Categorizes the given text.
|
double[] |
categorize(java.lang.String[] text,
java.util.Map<java.lang.String,java.lang.Object> extraInformation) |
double[] |
categorize(java.lang.String documentText,
java.util.Map<java.lang.String,java.lang.Object> extraInformation)
Categorizes the given text.
|
java.lang.String |
getAllResults(double[] results) |
java.lang.String |
getBestCategory(double[] outcome) |
java.lang.String |
getCategory(int index) |
int |
getIndex(java.lang.String category) |
int |
getNumberOfCategories() |
java.util.Map<java.lang.String,java.lang.Double> |
scoreMap(java.lang.String text)
Returns a map in which the key is the category name and the value is the score
|
java.util.SortedMap<java.lang.Double,java.util.Set<java.lang.String>> |
sortedScoreMap(java.lang.String text)
Returns a map with the score as a key in ascendng order.
|
static DoccatModel |
train(java.lang.String languageCode,
ObjectStream<DocumentSample> samples)
Deprecated.
|
static DoccatModel |
train(java.lang.String languageCode,
ObjectStream<DocumentSample> samples,
TrainingParameters mlParams,
DoccatFactory factory) |
static DoccatModel |
train(java.lang.String languageCode,
ObjectStream<DocumentSample> samples,
TrainingParameters mlParams,
FeatureGenerator... featureGenerators)
Deprecated.
|
public DocumentCategorizerME(DoccatModel model, FeatureGenerator... featureGenerators)
DoccatModel with a specific
DoccatFactory to customize the FeatureGeneratorsmodel - featureGenerators - public DocumentCategorizerME(DoccatModel model)
model - public double[] categorize(java.lang.String[] text,
java.util.Map<java.lang.String,java.lang.Object> extraInformation)
categorize in interface DocumentCategorizerpublic double[] categorize(java.lang.String[] text)
categorize in interface DocumentCategorizertext - public double[] categorize(java.lang.String documentText,
java.util.Map<java.lang.String,java.lang.Object> extraInformation)
DoccatFactory.getTokenizer() and defaults to
SimpleTokenizer.categorize in interface DocumentCategorizerpublic double[] categorize(java.lang.String documentText)
categorize in interface DocumentCategorizerpublic java.util.Map<java.lang.String,java.lang.Double> scoreMap(java.lang.String text)
scoreMap in interface DocumentCategorizertext - the input text to classifypublic java.util.SortedMap<java.lang.Double,java.util.Set<java.lang.String>> sortedScoreMap(java.lang.String text)
sortedScoreMap in interface DocumentCategorizertext - the input text to classifypublic java.lang.String getBestCategory(double[] outcome)
getBestCategory in interface DocumentCategorizerpublic int getIndex(java.lang.String category)
getIndex in interface DocumentCategorizerpublic java.lang.String getCategory(int index)
getCategory in interface DocumentCategorizerpublic int getNumberOfCategories()
getNumberOfCategories in interface DocumentCategorizerpublic java.lang.String getAllResults(double[] results)
getAllResults in interface DocumentCategorizerpublic static DoccatModel train(java.lang.String languageCode, ObjectStream<DocumentSample> samples, TrainingParameters mlParams, FeatureGenerator... featureGenerators) throws java.io.IOException
train(String, ObjectStream, TrainingParameters, DoccatFactory)
instead.java.io.IOExceptionpublic static DoccatModel train(java.lang.String languageCode, ObjectStream<DocumentSample> samples, TrainingParameters mlParams, DoccatFactory factory) throws java.io.IOException
java.io.IOExceptionpublic static DoccatModel train(java.lang.String languageCode, ObjectStream<DocumentSample> samples) throws java.io.IOException
train(String, ObjectStream, TrainingParameters, DoccatFactory)
instead.languageCode - samples - java.io.IOExceptionjava.io.ObjectStreamExceptionCopyright © 2010 - 2019 Adobe. All Rights Reserved