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 SummaryFields inherited from class opennlp.tools.util.model.BaseModelTRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
- 
Constructor SummaryConstructorsConstructorDescriptionPOSModel(InputStream in) Initializes aPOSModelinstance via a validInputStream.POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.POSModel(String languageCode, MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.POSModel(String languageCode, SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanRetrieves the class which can serialize and recreate this artifact.inthashCode()Methods inherited from class opennlp.tools.util.model.BaseModelgetArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
- 
Constructor Details- 
POSModelpublic POSModel(String languageCode, SequenceClassificationModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- posModel- A valid- SequenceClassificationModel.
- manifestInfoEntries- Additional information kept in the manifest.
- posFactory- The- POSTaggerFactoryfor creating related objects.
 
- 
POSModelpublic POSModel(String languageCode, MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- posModel- A valid- MaxentModel.
- manifestInfoEntries- Additional information kept in the manifest.
- posFactory- The- POSTaggerFactoryfor creating related objects.
 
- 
POSModelpublic POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) Initializes aPOSModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- posModel- A valid- MaxentModel.
- beamSize- The size of the beam that should be used when decoding sequences.
- manifestInfoEntries- Additional information kept in the manifest.
- posFactory- The- POSTaggerFactoryfor creating related objects.
 
- 
POSModelInitializes aPOSModelinstance via a validInputStream.- Parameters:
- in- The- InputStreamused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
POSModel- Parameters:
- modelFile- The- Fileused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
POSModel- Parameters:
- modelPath- The- Pathused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
POSModel- Parameters:
- modelURL- The- URLused 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.
 
- 
getArtifactSerializerClassDescription copied from interface:SerializableArtifactRetrieves the class which can serialize and recreate this artifact.Note: The serializer class must have a public zero argument constructoror an exception is thrown during model serialization/loading.- Specified by:
- getArtifactSerializerClassin interface- SerializableArtifact
- Returns:
- The corresponding ArtifactSerializerclass.
 
- 
hashCodepublic int hashCode()
- 
equals
 
-