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
TheLemmatizerModelis 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 aLemmatizerModelinstance via a validFile.LemmatizerModel(InputStream in)Initializes aLemmatizerModelinstance via a validInputStream.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)Initializes aLemmatizerModelinstance via given parameters.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)Initializes aLemmatizerModelinstance via given parameters.LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, LemmatizerFactory factory)Initializes aLemmatizerModelinstance via given parameters.LemmatizerModel(String languageCode, SequenceClassificationModel<String> lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)Initializes aLemmatizerModelinstance via given parameters.LemmatizerModel(URL modelURL)Initializes aLemmatizerModelinstance via a validURL.LemmatizerModel(Path modelPath)Initializes aLemmatizerModelinstance via a validPath.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LemmatizerFactorygetFactory()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 aLemmatizerModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.lemmatizerModel- A validSequenceClassificationModel.manifestInfoEntries- Additional information kept in the manifest.factory- TheLemmatizerFactoryfor creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.lemmatizerModel- A validMaxentModel.manifestInfoEntries- Additional information kept in the manifest.factory- TheLemmatizerFactoryfor creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
Initializes aLemmatizerModelinstance 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- TheLemmatizerFactoryfor creating related objects.
-
LemmatizerModel
public LemmatizerModel(String languageCode, MaxentModel lemmatizerModel, LemmatizerFactory factory)
Initializes aLemmatizerModelinstance via given parameters.- Parameters:
languageCode- An ISO conform language code.lemmatizerModel- A validMaxentModel.factory- TheLemmatizerFactoryfor creating related objects.
-
LemmatizerModel
public LemmatizerModel(InputStream in) throws IOException
Initializes aLemmatizerModelinstance via a validInputStream.- Parameters:
in- TheInputStreamused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(File modelFile) throws IOException
Initializes aLemmatizerModelinstance via a validFile.- Parameters:
modelFile- TheFileused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(Path modelPath) throws IOException
Initializes aLemmatizerModelinstance via a validPath.- Parameters:
modelPath- ThePathused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
LemmatizerModel
public LemmatizerModel(URL modelURL) throws IOException
Initializes aLemmatizerModelinstance via a validURL.- Parameters:
modelURL- TheURLused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
-
Method Detail
-
getLemmatizerSequenceModel
public SequenceClassificationModel<String> getLemmatizerSequenceModel()
- Returns:
- Retrieves a
SequenceClassificationModelinstance.
-
getFactory
public LemmatizerFactory getFactory()
- Returns:
- Retrieves the active
LemmatizerFactory.
-
-