Package opennlp.tools.postag
Class POSModel
- java.lang.Object
 - 
- opennlp.tools.util.model.BaseModel
 - 
- opennlp.tools.postag.POSModel
 
 
 
- 
- All Implemented Interfaces:
 Serializable,ArtifactProvider,SerializableArtifact
public final class POSModel extends BaseModel implements SerializableArtifact
- See Also:
 POSTaggerME, 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 POSModel(File modelFile)POSModel(InputStream in)POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)POSModel(String languageCode, MaxentModel posModel, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)POSModel(String languageCode, SequenceClassificationModel<String> posModel, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)POSModel(URL modelURL)POSModel(Path modelPath) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Class<POSModelSerializer>getArtifactSerializerClass()Retrieves the class which can serialize and recreate this artifact.POSTaggerFactorygetFactory()DictionarygetNgramDictionary()Retrieves the ngram dictionary.MaxentModelgetPosModel()Deprecated.use getPosSequenceModel instead.SequenceClassificationModel<String>getPosSequenceModel()- 
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
POSModel
public POSModel(String languageCode, SequenceClassificationModel<String> posModel, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)
 
- 
POSModel
public POSModel(String languageCode, MaxentModel posModel, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)
 
- 
POSModel
public POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)
 
- 
POSModel
public POSModel(InputStream in) throws IOException
- Throws:
 IOException
 
- 
POSModel
public POSModel(File modelFile) throws IOException
- Throws:
 IOException
 
- 
POSModel
public POSModel(Path modelPath) throws IOException
- Throws:
 IOException
 
- 
POSModel
public POSModel(URL modelURL) throws IOException
- Throws:
 IOException
 
 - 
 
- 
Method Detail
- 
getPosModel
@Deprecated public MaxentModel getPosModel()
Deprecated.use getPosSequenceModel instead. This method will be removed soon. Only required for Parser 1.5.x backward compatibility. Newer models don't need this anymore. 
- 
getPosSequenceModel
public SequenceClassificationModel<String> getPosSequenceModel()
 
- 
getFactory
public POSTaggerFactory getFactory()
 
- 
getNgramDictionary
public Dictionary getNgramDictionary()
Retrieves the ngram dictionary.- Returns:
 - ngram dictionary or null if not used
 
 
- 
getArtifactSerializerClass
public Class<POSModelSerializer> getArtifactSerializerClass()
Description copied from interface:SerializableArtifactRetrieves 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:
 getArtifactSerializerClassin interfaceSerializableArtifact- Returns:
 - the corresponding ArtifactSerializer class.
 
 
 - 
 
 -