Package opennlp.tools.chunker

## Class ChunkerModel

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

- All Implemented Interfaces:
    `Serializable`, `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, MaxentModel chunkerModel, int beamSize, Map<String,​String> manifestInfoEntries, ChunkerFactory factory)` | Initializes a `ChunkerModel` instance via given parameters.
    `ChunkerModel​(String languageCode, MaxentModel chunkerModel, Map<String,​String> manifestInfoEntries, ChunkerFactory factory)` | Initializes a `ChunkerModel` instance via given parameters.
    `ChunkerModel​(String languageCode, MaxentModel chunkerModel, ChunkerFactory factory)` | Initializes a `ChunkerModel` instance via given parameters.
    `ChunkerModel​(String languageCode, SequenceClassificationModel<String> 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

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MaxentModel` | `getChunkerModel()` | Deprecated. use `getChunkerSequenceModel()` instead.
    `SequenceClassificationModel<TokenTag>` | `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 Detail

    - #### ChunkerModel

          public ChunkerModel​(String languageCode,
                              SequenceClassificationModel<String> 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,
                              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,
                              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,
                              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 Detail

    - #### getChunkerModel

          @Deprecated
          public MaxentModel getChunkerModel()

      Deprecated.
      use `getChunkerSequenceModel()` instead. This method will be removed soon.

    - #### getChunkerSequenceModel

          public SequenceClassificationModel<TokenTag> getChunkerSequenceModel()

      Returns:
        Retrieves a `SequenceClassificationModel`.

    - #### getFactory

          public ChunkerFactory getFactory()

      Returns:
        Retrieves the active `ChunkerFactory`.