Package opennlp.tools.lemmatizer

# Class LemmatizerModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.lemmatizer.LemmatizerModel

All Implemented Interfaces:
  `Serializable`, `opennlp.tools.util.model.ArtifactProvider`

public class LemmatizerModel extends BaseModel
The `LemmatizerModel` is the model used by a learnable `Lemmatizer`.

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 a `LemmatizerModel` instance via a valid `File`.
  `LemmatizerModel(InputStream in)`
  Initializes a `LemmatizerModel` instance via a valid `InputStream`.
  `LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)`
  Initializes a `LemmatizerModel` instance via given parameters.
  `LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)`
  Initializes a `LemmatizerModel` instance via given parameters.
  `LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, LemmatizerFactory factory)`
  Initializes a `LemmatizerModel` instance via given parameters.
  `LemmatizerModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)`
  Initializes a `LemmatizerModel` instance via given parameters.
  `LemmatizerModel(URL modelURL)`
  Initializes a `LemmatizerModel` instance via a valid `URL`.
  `LemmatizerModel(Path modelPath)`
  Initializes a `LemmatizerModel` instance via a valid `Path`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LemmatizerFactory`
  `getFactory()`
  `opennlp.tools.ml.model.SequenceClassificationModel`
  `getLemmatizerSequenceModel()`

  ### Methods inherited from class opennlp.tools.util.model.BaseModel

  `getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LemmatizerModel

    public LemmatizerModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
    Initializes a `LemmatizerModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `lemmatizerModel` - A valid `SequenceClassificationModel`.
      `manifestInfoEntries` - Additional information kept in the manifest.
      `factory` - The `LemmatizerFactory` for creating related objects.

  - ### LemmatizerModel

    public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
    Initializes a `LemmatizerModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `lemmatizerModel` - A valid `MaxentModel`.
      `manifestInfoEntries` - Additional information kept in the manifest.
      `factory` - The `LemmatizerFactory` for creating related objects.

  - ### LemmatizerModel

    public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
    Initializes a `LemmatizerModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `lemmatizerModel` - A valid `MaxentModel`.
      `beamSize` - The size of the beam that should be used when decoding sequences.
      `manifestInfoEntries` - Additional information kept in the manifest.
      `factory` - The `LemmatizerFactory` for creating related objects.

  - ### LemmatizerModel

    public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, LemmatizerFactory factory)
    Initializes a `LemmatizerModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `lemmatizerModel` - A valid `MaxentModel`.
      `factory` - The `LemmatizerFactory` for creating related objects.

  - ### LemmatizerModel

    public LemmatizerModel(InputStream in) throws IOException
    Initializes a `LemmatizerModel` instance via a valid `InputStream`.
    Parameters:
      `in` - The `InputStream` used for loading the model.
    Throws:
      `IOException` - Thrown if IO errors occurred during initialization.

  - ### LemmatizerModel

    public LemmatizerModel(File modelFile) throws IOException
    Initializes a `LemmatizerModel` instance via a valid `File`.
    Parameters:
      `modelFile` - The `File` used for loading the model.
    Throws:
      `IOException` - Thrown if IO errors occurred during initialization.

  - ### LemmatizerModel

    public LemmatizerModel(Path modelPath) throws IOException
    Initializes a `LemmatizerModel` instance via a valid `Path`.
    Parameters:
      `modelPath` - The `Path` used for loading the model.
    Throws:
      `IOException` - Thrown if IO errors occurred during initialization.

  - ### LemmatizerModel

    public LemmatizerModel(URL modelURL) throws IOException
    Initializes a `LemmatizerModel` instance via a valid `URL`.
    Parameters:
      `modelURL` - The `URL` used for loading the model.
    Throws:
      `IOException` - Thrown if IO errors occurred during initialization.

- ## Method Details

  - ### getLemmatizerSequenceModel

    public opennlp.tools.ml.model.SequenceClassificationModel getLemmatizerSequenceModel()
    Returns:
      Retrieves a `SequenceClassificationModel` instance.

  - ### getFactory

    public LemmatizerFactory getFactory()
    Returns:
      Retrieves the active `LemmatizerFactory`.