opennlp.tools.doccat
Class DocumentCategorizerME

java.lang.Object
  extended by opennlp.tools.doccat.DocumentCategorizerME
All Implemented Interfaces:
DocumentCategorizer

public class DocumentCategorizerME
extends java.lang.Object
implements DocumentCategorizer

Maxent implementation of DocumentCategorizer.


Constructor Summary
DocumentCategorizerME(opennlp.maxent.MaxentModel model)
          Initializes the current instance with the given MaxentModel.
DocumentCategorizerME(opennlp.maxent.MaxentModel model, FeatureGenerator[] featureGenerators)
          Initializes the current instance with a the given MaxentModel and FeatureGenerators.
 
Method Summary
 double[] categorize(java.lang.String documentText)
           
 double[] categorize(java.lang.String[] text)
          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()
           
static opennlp.maxent.GISModel train(DocumentCategorizerEventStream eventStream)
          Trains a new model for the DocumentCategorizerME.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCategorizerME

public DocumentCategorizerME(opennlp.maxent.MaxentModel model)
Initializes the current instance with the given MaxentModel.

Parameters:
model -

DocumentCategorizerME

public DocumentCategorizerME(opennlp.maxent.MaxentModel model,
                             FeatureGenerator[] featureGenerators)
Initializes the current instance with a the given MaxentModel and FeatureGenerators.

Parameters:
model -
featureGenerators -
Method Detail

categorize

public double[] categorize(java.lang.String[] text)
Categorizes the given text.

Specified by:
categorize in interface DocumentCategorizer
Parameters:
text -

categorize

public double[] categorize(java.lang.String documentText)
Specified by:
categorize in interface DocumentCategorizer

getBestCategory

public java.lang.String getBestCategory(double[] outcome)
Specified by:
getBestCategory in interface DocumentCategorizer

getIndex

public int getIndex(java.lang.String category)
Specified by:
getIndex in interface DocumentCategorizer

getCategory

public java.lang.String getCategory(int index)
Specified by:
getCategory in interface DocumentCategorizer

getNumberOfCategories

public int getNumberOfCategories()
Specified by:
getNumberOfCategories in interface DocumentCategorizer

getAllResults

public java.lang.String getAllResults(double[] results)
Specified by:
getAllResults in interface DocumentCategorizer

train

public static opennlp.maxent.GISModel train(DocumentCategorizerEventStream eventStream)
                                     throws java.io.IOException
Trains a new model for the DocumentCategorizerME.

Parameters:
eventStream -
Returns:
the new model
Throws:
java.io.IOException


Copyright 2008 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.