|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.doccat.DocumentCategorizerME
public class DocumentCategorizerME
Maxent implementation of DocumentCategorizer
.
Constructor Summary | |
---|---|
DocumentCategorizerME(DoccatModel model)
Initializes the current instance with a doccat model. |
|
DocumentCategorizerME(DoccatModel model,
FeatureGenerator... featureGenerators)
Initializes a the current instance with a doccat model and custom feature generation. |
|
DocumentCategorizerME(opennlp.model.MaxentModel model)
Deprecated. Use DocumentCategorizerME(DoccatModel) instead. |
|
DocumentCategorizerME(opennlp.model.MaxentModel model,
FeatureGenerator... featureGenerators)
Deprecated. Use DocumentCategorizerME(DoccatModel, FeatureGenerator...) instead. |
Method Summary | |
---|---|
double[] |
categorize(String documentText)
|
double[] |
categorize(String[] text)
Categorizes the given text. |
String |
getAllResults(double[] results)
|
String |
getBestCategory(double[] outcome)
|
String |
getCategory(int index)
|
int |
getIndex(String category)
|
int |
getNumberOfCategories()
|
static opennlp.model.AbstractModel |
train(DocumentCategorizerEventStream eventStream)
Deprecated. |
static DoccatModel |
train(String languageCode,
ObjectStream<DocumentSample> samples)
Trains a doccat model with default feature generation. |
static DoccatModel |
train(String languageCode,
ObjectStream<DocumentSample> samples,
int cutoff,
int iterations,
FeatureGenerator... featureGenerators)
Trains a document categorizer model with custom feature generation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentCategorizerME(DoccatModel model, FeatureGenerator... featureGenerators)
model
- featureGenerators
- public DocumentCategorizerME(DoccatModel model)
model
- @Deprecated public DocumentCategorizerME(opennlp.model.MaxentModel model)
DocumentCategorizerME(DoccatModel)
instead.
MaxentModel
.
model
- @Deprecated public DocumentCategorizerME(opennlp.model.MaxentModel model, FeatureGenerator... featureGenerators)
DocumentCategorizerME(DoccatModel, FeatureGenerator...)
instead.
MaxentModel
and FeatureGenerator
s.
model
- featureGenerators
- Method Detail |
---|
public double[] categorize(String[] text)
categorize
in interface DocumentCategorizer
text
- public double[] categorize(String documentText)
categorize
in interface DocumentCategorizer
public String getBestCategory(double[] outcome)
getBestCategory
in interface DocumentCategorizer
public int getIndex(String category)
getIndex
in interface DocumentCategorizer
public String getCategory(int index)
getCategory
in interface DocumentCategorizer
public int getNumberOfCategories()
getNumberOfCategories
in interface DocumentCategorizer
public String getAllResults(double[] results)
getAllResults
in interface DocumentCategorizer
@Deprecated public static opennlp.model.AbstractModel train(DocumentCategorizerEventStream eventStream) throws IOException
DocumentCategorizerME
.
eventStream
-
IOException
public static DoccatModel train(String languageCode, ObjectStream<DocumentSample> samples, int cutoff, int iterations, FeatureGenerator... featureGenerators) throws IOException
languageCode
- samples
- cutoff
- iterations
- featureGenerators
-
IOException
public static DoccatModel train(String languageCode, ObjectStream<DocumentSample> samples) throws IOException
languageCode
- samples
-
IOException
ObjectStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |