Package opennlp.tools.postag
Class POSModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.postag.POSModel
- All Implemented Interfaces:
Serializable
,ArtifactProvider
,SerializableArtifact
- See Also:
-
Field Summary
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
-
Constructor Summary
ConstructorDescriptionPOSModel
(InputStream in) Initializes aPOSModel
instance via a validInputStream
.POSModel
(String languageCode, MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance via given parameters.POSModel
(String languageCode, MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance via given parameters.POSModel
(String languageCode, SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance via given parameters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves the class which can serialize and recreate this artifact.int
hashCode()
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
POSModel
public POSModel(String languageCode, SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.posModel
- A validSequenceClassificationModel
.manifestInfoEntries
- Additional information kept in the manifest.posFactory
- ThePOSTaggerFactory
for creating related objects.
-
POSModel
public POSModel(String languageCode, MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.posModel
- A validMaxentModel
.manifestInfoEntries
- Additional information kept in the manifest.posFactory
- ThePOSTaggerFactory
for creating related objects.
-
POSModel
public POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModel
instance 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
- ThePOSTaggerFactory
for creating related objects.
-
POSModel
Initializes aPOSModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
POSModel
- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Details
-
getPosSequenceModel
- Returns:
- Retrieves a
SequenceClassificationModel
.
-
getFactory
- Returns:
- Retrieves the active
POSTaggerFactory
.
-
getArtifactSerializerClass
Description copied from interface:SerializableArtifact
Retrieves the class which can serialize and recreate this artifact.Note: The serializer class must have a
public zero argument constructor
or an exception is thrown during model serialization/loading.- Specified by:
getArtifactSerializerClass
in interfaceSerializableArtifact
- Returns:
- The corresponding
ArtifactSerializer
class.
-
hashCode
public int hashCode() -
equals
-