Package opennlp.tools.namefind
Class TokenNameFinderModel
- java.lang.Object
-
- opennlp.tools.util.model.BaseModel
-
- opennlp.tools.namefind.TokenNameFinderModel
-
- All Implemented Interfaces:
java.io.Serializable
,ArtifactProvider
public class TokenNameFinderModel extends BaseModel
TheTokenNameFinderModel
is the model used by a learnableTokenNameFinder
.- See Also:
NameFinderME
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TokenNameFinderModel.FeatureGeneratorCreationError
-
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 TokenNameFinderModel(java.io.File modelFile)
TokenNameFinderModel(java.io.InputStream in)
TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries)
TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries, SequenceCodec<java.lang.String> seqCodec, TokenNameFinderFactory factory)
TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries)
TokenNameFinderModel(java.lang.String languageCode, SequenceClassificationModel<java.lang.String> nameFinderModel, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries, SequenceCodec<java.lang.String> seqCodec, TokenNameFinderFactory factory)
TokenNameFinderModel(java.net.URL modelURL)
TokenNameFinderModel(java.nio.file.Path modelPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,ArtifactSerializer>
createArtifactSerializers()
Create the artifact serializers.TokenNameFinderFactory
getFactory()
SequenceClassificationModel<java.lang.String>
getNameFinderSequenceModel()
SequenceCodec<java.lang.String>
getSequenceCodec()
-
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
-
-
-
Constructor Detail
-
TokenNameFinderModel
public TokenNameFinderModel(java.lang.String languageCode, SequenceClassificationModel<java.lang.String> nameFinderModel, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries, SequenceCodec<java.lang.String> seqCodec, TokenNameFinderFactory factory)
-
TokenNameFinderModel
public TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries, SequenceCodec<java.lang.String> seqCodec, TokenNameFinderFactory factory)
-
TokenNameFinderModel
public TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, byte[] generatorDescriptor, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries)
-
TokenNameFinderModel
public TokenNameFinderModel(java.lang.String languageCode, MaxentModel nameFinderModel, java.util.Map<java.lang.String,java.lang.Object> resources, java.util.Map<java.lang.String,java.lang.String> manifestInfoEntries)
-
TokenNameFinderModel
public TokenNameFinderModel(java.io.InputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
TokenNameFinderModel
public TokenNameFinderModel(java.io.File modelFile) throws java.io.IOException
- Throws:
java.io.IOException
-
TokenNameFinderModel
public TokenNameFinderModel(java.nio.file.Path modelPath) throws java.io.IOException
- Throws:
java.io.IOException
-
TokenNameFinderModel
public TokenNameFinderModel(java.net.URL modelURL) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getNameFinderSequenceModel
public SequenceClassificationModel<java.lang.String> getNameFinderSequenceModel()
-
getSequenceCodec
public SequenceCodec<java.lang.String> getSequenceCodec()
-
getFactory
public TokenNameFinderFactory getFactory()
-
createArtifactSerializers
public static java.util.Map<java.lang.String,ArtifactSerializer> createArtifactSerializers()
Create the artifact serializers. Currently for serializers related to features that require external resources, such asW2VClassesDictionary
objects, the convention is to add its element tag name as key of the serializer map. For example, the element tag name for theWordClusterFeatureGenerator
which usesW2VClassesDictionary
objects serialized by theW2VClassesDictionarySerializer
is 'wordcluster', which is the key used to add the serializer to the map.- Returns:
- the map containing the added serializers
-
-