Package opennlp.tools.doccat
Class DoccatModel
- java.lang.Object
-
- opennlp.tools.util.model.BaseModel
-
- opennlp.tools.doccat.DoccatModel
-
- All Implemented Interfaces:
Serializable
,ArtifactProvider
public class DoccatModel extends BaseModel
A model for document categorization- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DoccatModel(File modelFile)
Initializes aDoccatModel
instance via a validFile
.DoccatModel(InputStream in)
Initializes aDoccatModel
instance via a validInputStream
.DoccatModel(String languageCode, MaxentModel doccatModel, Map<String,String> manifestInfoEntries, DoccatFactory factory)
Initializes aDoccatModel
instance via given parameters.DoccatModel(URL modelURL)
Initializes aDoccatModel
instance via a validURL
.DoccatModel(Path modelPath)
Initializes aDoccatModel
instance via a validPath
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoccatFactory
getFactory()
MaxentModel
getMaxentModel()
-
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
-
-
-
Constructor Detail
-
DoccatModel
public DoccatModel(String languageCode, MaxentModel doccatModel, Map<String,String> manifestInfoEntries, DoccatFactory factory)
Initializes aDoccatModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.doccatModel
- A validMaxentModel
to be used.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheDoccatFactory
to be used.
-
DoccatModel
public DoccatModel(InputStream in) throws IOException
Initializes aDoccatModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
DoccatModel
public DoccatModel(File modelFile) throws IOException
Initializes aDoccatModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
DoccatModel
public DoccatModel(Path modelPath) throws IOException
Initializes aDoccatModel
instance via a validPath
.- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
DoccatModel
public DoccatModel(URL modelURL) throws IOException
Initializes aDoccatModel
instance via a validURL
.- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Detail
-
getFactory
public DoccatFactory getFactory()
- Returns:
- Retrieves the active
DoccatFactory
.
-
getMaxentModel
public MaxentModel getMaxentModel()
- Returns:
- Retrieves the active
MaxentModel
.
-
-