Package opennlp.tools.lemmatizer
Class LemmatizerModel
- java.lang.Object
-
- opennlp.tools.util.model.BaseModel
-
- opennlp.tools.lemmatizer.LemmatizerModel
-
- All Implemented Interfaces:
Serializable
,ArtifactProvider
public class LemmatizerModel extends BaseModel
TheLemmatizerModel
is the model used by a learnableLemmatizer
.- See Also:
LemmatizerME
, 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 LemmatizerModel(File modelFile)
Initializes aLemmatizerModel
instance via a validFile
.LemmatizerModel(InputStream in)
Initializes aLemmatizerModel
instance via a validInputStream
.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.LemmatizerModel(String languageCode, SequenceClassificationModel<String> lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.LemmatizerModel(URL modelURL)
Initializes aLemmatizerModel
instance via a validURL
.LemmatizerModel(Path modelPath)
Initializes aLemmatizerModel
instance via a validPath
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LemmatizerFactory
getFactory()
SequenceClassificationModel<String>
getLemmatizerSequenceModel()
-
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
-
-
-
Constructor Detail
-
LemmatizerModel
public LemmatizerModel(String languageCode, SequenceClassificationModel<String> lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.lemmatizerModel
- A validSequenceClassificationModel
.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheLemmatizerFactory
for creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.lemmatizerModel
- A validMaxentModel
.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheLemmatizerFactory
for creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.lemmatizerModel
- A validMaxentModel
.beamSize
- The size of the beam that should be used when decoding sequences.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheLemmatizerFactory
for creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, LemmatizerFactory factory)
Initializes aLemmatizerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.lemmatizerModel
- A validMaxentModel
.factory
- TheLemmatizerFactory
for creating related objects.
-
LemmatizerModel
public LemmatizerModel(InputStream in) throws IOException
Initializes aLemmatizerModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(File modelFile) throws IOException
Initializes aLemmatizerModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(Path modelPath) throws IOException
Initializes aLemmatizerModel
instance via a validPath
.- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(URL modelURL) throws IOException
Initializes aLemmatizerModel
instance via a validURL
.- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Detail
-
getLemmatizerSequenceModel
public SequenceClassificationModel<String> getLemmatizerSequenceModel()
- Returns:
- Retrieves a
SequenceClassificationModel
instance.
-
getFactory
public LemmatizerFactory getFactory()
- Returns:
- Retrieves the active
LemmatizerFactory
.
-
-