public final class POSModel extends BaseModel
POSTaggerME| Modifier and Type | Field and Description |
|---|---|
static String |
POS_MODEL_ENTRY_NAME |
artifactMap, FACTORY_NAME, MANIFEST_ENTRY, toolFactory, TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY| Constructor and Description |
|---|
POSModel(File modelFile) |
POSModel(InputStream in) |
POSModel(String languageCode,
AbstractModel posModel,
Map<String,String> manifestInfoEntries,
POSTaggerFactory posFactory) |
POSModel(String languageCode,
AbstractModel posModel,
POSDictionary tagDictionary,
Dictionary ngramDict)
Deprecated.
|
POSModel(String languageCode,
AbstractModel posModel,
POSDictionary tagDictionary,
Dictionary ngramDict,
Map<String,String> manifestInfoEntries)
Deprecated.
|
POSModel(URL modelURL) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createArtifactSerializers(Map<String,ArtifactSerializer> serializers)
Registers all
ArtifactSerializer for their artifact file name extensions. |
protected Class<? extends BaseToolFactory> |
getDefaultFactory()
Sub-classes should override this method if their module has a default
BaseToolFactory sub-class.
|
POSTaggerFactory |
getFactory() |
Dictionary |
getNgramDictionary()
Retrieves the ngram dictionary.
|
AbstractModel |
getPosModel() |
POSDictionary |
getTagDictionary()
Deprecated.
Use
getFactory() to get a
POSTaggerFactory and
POSTaggerFactory.getTagDictionary() to get a
TagDictionary. |
protected void |
validateArtifactMap()
Validates the parsed artifacts.
|
checkArtifactMap, createArtifactSerializers, getArtifact, getArtifactSerializer, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, setManifestPropertypublic static final String POS_MODEL_ENTRY_NAME
public POSModel(String languageCode, AbstractModel posModel, POSDictionary tagDictionary, Dictionary ngramDict, Map<String,String> manifestInfoEntries)
POSModel(String, AbstractModel, Map, POSTaggerFactory)
instead.public POSModel(String languageCode, AbstractModel posModel, POSDictionary tagDictionary, Dictionary ngramDict)
POSModel(String, AbstractModel, Map, POSTaggerFactory)
instead.public POSModel(String languageCode, AbstractModel posModel, Map<String,String> manifestInfoEntries, POSTaggerFactory posFactory)
public POSModel(InputStream in) throws IOException, InvalidFormatException
IOExceptionInvalidFormatExceptionpublic POSModel(File modelFile) throws IOException, InvalidFormatException
IOExceptionInvalidFormatExceptionpublic POSModel(URL modelURL) throws IOException, InvalidFormatException
IOExceptionInvalidFormatExceptionprotected Class<? extends BaseToolFactory> getDefaultFactory()
BaseModelgetDefaultFactory in class BaseModelBaseToolFactory for the module, or null if none.protected void createArtifactSerializers(Map<String,ArtifactSerializer> serializers)
BaseModelArtifactSerializer for their artifact file name extensions.
The registered ArtifactSerializer are used to create and serialize
resources in the model package.
Override this method to register custom ArtifactSerializers.
Note:
Subclasses should generally invoke super.createArtifactSerializers at the beginning
of this method.
This method is called during construction.createArtifactSerializers in class BaseModelserializers - the key of the map is the file extension used to lookup
the ArtifactSerializer.protected void validateArtifactMap()
throws InvalidFormatException
BaseModelInvalidFormatException.
Note:
Subclasses should generally invoke super.validateArtifactMap at the beginning
of this method.validateArtifactMap in class BaseModelInvalidFormatExceptionpublic AbstractModel getPosModel()
public POSDictionary getTagDictionary()
getFactory() to get a
POSTaggerFactory and
POSTaggerFactory.getTagDictionary() to get a
TagDictionary.IllegalStateException - if the TagDictionary is not an instance of POSDictionarypublic POSTaggerFactory getFactory()
public Dictionary getNgramDictionary()
Copyright © 2019 The Apache Software Foundation. All rights reserved.