Package opennlp.tools.util.model

# Class BaseModel

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

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

Direct Known Subclasses:
  `BPEModel`, `ChunkerModel`, `DoccatModel`, `LanguageDetectorModel`, `LemmatizerModel`, `ParserModel`, `POSModel`, `SentenceModel`, `SentimentModel`, `TokenizerModel`, `TokenNameFinderModel`

public abstract class BaseModel extends Object implements opennlp.tools.util.model.ArtifactProvider, Serializable
This is a common base model which can be used by the components' specific model classes.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `TRAINING_CUTOFF_PROPERTY`
  `static final String`
  `TRAINING_EVENTHASH_PROPERTY`
  `static final String`
  `TRAINING_ITERATIONS_PROPERTY`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T> T`
  `getArtifact(String key)`
  `final String`
  `getLanguage()`
  `final String`
  `getManifestProperty(String key)`
  `final Version`
  `getVersion()`
  `boolean`
  `isLoadedFromSerialized()`
  `final void`
  `serialize(File f)`
  Serializes the model to the specified `File`.
  `final void`
  `serialize(OutputStream out)`
  Serializes the model to the given `OutputStream`.
  `final void`
  `serialize(Path p)`
  Serializes the model to the specified `Path`.

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

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

- ## Field Details

  - ### TRAINING_CUTOFF_PROPERTY

    public static final String TRAINING_CUTOFF_PROPERTY
    See Also:
      - Constant Field Values

  - ### TRAINING_ITERATIONS_PROPERTY

    public static final String TRAINING_ITERATIONS_PROPERTY
    See Also:
      - Constant Field Values

  - ### TRAINING_EVENTHASH_PROPERTY

    public static final String TRAINING_EVENTHASH_PROPERTY
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getManifestProperty

    public final String getManifestProperty(String key)
    Specified by:
      `getManifestProperty` in interface `opennlp.tools.util.model.ArtifactProvider`

  - ### getLanguage

    public final String getLanguage()
    Specified by:
      `getLanguage` in interface `opennlp.tools.util.model.ArtifactProvider`

  - ### getVersion

    public final Version getVersion()
    Returns:
      Retrieves the OpenNLP `Version` which was used to create the model.

  - ### serialize

    public final void serialize(OutputStream out) throws IOException
    Serializes the model to the given `OutputStream`.
    Parameters:
      `out` - The `OutputStream` to write the model to.
    Throws:
      `IOException` - Thrown if IO errors occurred.
      `IllegalStateException` - Thrown if `loadArtifactSerializers()` was not called in a subclass constructor.

  - ### serialize

    public final void serialize(File f) throws IOException
    Serializes the model to the specified `File`.
    Parameters:
      `f` - The write-accessible `File` to write the model to.
    Throws:
      `IOException` - Thrown if IO errors occurred.
      `IllegalStateException` - Thrown if `loadArtifactSerializers()` was not called in a subclass constructor.

  - ### serialize

    public final void serialize(Path p) throws IOException
    Serializes the model to the specified `Path`.
    Parameters:
      `p` - The write-accessible `Path` to write the model to.
    Throws:
      `IOException` - Thrown if IO errors occurred.
      `IllegalStateException` - Thrown if `loadArtifactSerializers()` was not called in a subclass constructor.

  - ### getArtifact

    public <T> T getArtifact(String key)
    Specified by:
      `getArtifact` in interface `opennlp.tools.util.model.ArtifactProvider`

  - ### isLoadedFromSerialized

    public boolean isLoadedFromSerialized()
    Specified by:
      `isLoadedFromSerialized` in interface `opennlp.tools.util.model.ArtifactProvider`