Package opennlp.tools.namefind
Class TokenNameFinderModel
- java.lang.Object
-
- opennlp.tools.util.model.BaseModel
-
- opennlp.tools.namefind.TokenNameFinderModel
-
- All Implemented Interfaces:
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(File modelFile)
TokenNameFinderModel(InputStream in)
TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
TokenNameFinderModel(String languageCode, SequenceClassificationModel<String> nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
TokenNameFinderModel(URL modelURL)
TokenNameFinderModel(Path modelPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<String,ArtifactSerializer>
createArtifactSerializers()
Create the artifact serializers.TokenNameFinderFactory
getFactory()
SequenceClassificationModel<String>
getNameFinderSequenceModel()
SequenceCodec<String>
getSequenceCodec()
-
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
-
-
-
Constructor Detail
-
TokenNameFinderModel
public TokenNameFinderModel(String languageCode, SequenceClassificationModel<String> nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
-
TokenNameFinderModel
public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
-
TokenNameFinderModel
public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
-
TokenNameFinderModel
public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
-
TokenNameFinderModel
public TokenNameFinderModel(InputStream in) throws IOException
- Throws:
IOException
-
TokenNameFinderModel
public TokenNameFinderModel(File modelFile) throws IOException
- Throws:
IOException
-
TokenNameFinderModel
public TokenNameFinderModel(Path modelPath) throws IOException
- Throws:
IOException
-
TokenNameFinderModel
public TokenNameFinderModel(URL modelURL) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getNameFinderSequenceModel
public SequenceClassificationModel<String> getNameFinderSequenceModel()
-
getSequenceCodec
public SequenceCodec<String> getSequenceCodec()
-
getFactory
public TokenNameFinderFactory getFactory()
-
createArtifactSerializers
public static Map<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
-
-