Package opennlp.tools.chunker

# Class ChunkerModel

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

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

public class ChunkerModel extends BaseModel
The `ChunkerModel` is the model used by a learnable `Chunker`.

See Also:
  - `ChunkerME`
  - 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
  `ChunkerModel(File modelFile)`
  Initializes a `ChunkerModel` instance via a valid `File`.
  `ChunkerModel(InputStream in)`
  Initializes a `ChunkerModel` instance via a valid `InputStream`.
  `ChunkerModel(String languageCode, opennlp.tools.ml.model.MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
  Initializes a `ChunkerModel` instance via given parameters.
  `ChunkerModel(String languageCode, opennlp.tools.ml.model.MaxentModel chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
  Initializes a `ChunkerModel` instance via given parameters.
  `ChunkerModel(String languageCode, opennlp.tools.ml.model.MaxentModel chunkerModel, ChunkerFactory factory)`
  Initializes a `ChunkerModel` instance via given parameters.
  `ChunkerModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
  Initializes a `ChunkerModel` instance via given parameters.
  `ChunkerModel(URL modelURL)`
  Initializes a `ChunkerModel` instance via a valid `URL`.
  `ChunkerModel(Path modelPath)`
  Initializes a `ChunkerModel` instance via a valid `Path`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `opennlp.tools.ml.model.SequenceClassificationModel`
  `getChunkerSequenceModel()`
  `ChunkerFactory`
  `getFactory()`

  ### 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

  - ### ChunkerModel

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

  - ### ChunkerModel

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

  - ### ChunkerModel

    public ChunkerModel(String languageCode, opennlp.tools.ml.model.MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
    Initializes a `ChunkerModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `chunkerModel` - 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 `ChunkerFactory` for creating related objects.

  - ### ChunkerModel

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

  - ### ChunkerModel

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

  - ### ChunkerModel

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

  - ### ChunkerModel

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

  - ### ChunkerModel

    public ChunkerModel(URL modelURL) throws IOException
    Initializes a `ChunkerModel` 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

  - ### getChunkerSequenceModel

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

  - ### getFactory

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