Class POSModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.postag.POSModel
- All Implemented Interfaces:
Serializable, opennlp.tools.util.model.ArtifactProvider, opennlp.tools.util.model.SerializableArtifact
-
Field Summary
Fields inherited from class BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionPOSModel(InputStream in) Initializes aPOSModelinstance via a validInputStream.POSModel(String languageCode, opennlp.tools.ml.model.MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.POSModel(String languageCode, opennlp.tools.ml.model.MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.POSModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanopennlp.tools.ml.model.SequenceClassificationModelinthashCode()Methods inherited from class BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
POSModel
public POSModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.posModel- A validSequenceClassificationModel.manifestInfoEntries- Additional information kept in the manifest.posFactory- ThePOSTaggerFactoryfor creating related objects.
-
POSModel
public POSModel(String languageCode, opennlp.tools.ml.model.MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.posModel- A validMaxentModel.manifestInfoEntries- Additional information kept in the manifest.posFactory- ThePOSTaggerFactoryfor creating related objects.
-
POSModel
public POSModel(String languageCode, opennlp.tools.ml.model.MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.posModel- A validMaxentModel.beamSize- The size of the beam that should be used when decoding sequences.manifestInfoEntries- Additional information kept in the manifest.posFactory- ThePOSTaggerFactoryfor creating related objects.
-
POSModel
Initializes aPOSModelinstance via a validInputStream.- Parameters:
in- TheInputStreamused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelFile- TheFileused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelPath- ThePathused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelURL- TheURLused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
-
Method Details
-
getPosSequenceModel
public opennlp.tools.ml.model.SequenceClassificationModel getPosSequenceModel()- Returns:
- Retrieves a
SequenceClassificationModel.
-
getFactory
- Returns:
- Retrieves the active
POSTaggerFactory.
-
getArtifactSerializerClass
- Specified by:
getArtifactSerializerClassin interfaceopennlp.tools.util.model.SerializableArtifact
-
hashCode
-
equals
-