Class TokenNameFinderModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.namefind.TokenNameFinderModel
All Implemented Interfaces:
Serializable, ArtifactProvider

public class TokenNameFinderModel extends BaseModel
The TokenNameFinderModel is the model used by a learnable TokenNameFinder.
See Also:
  • Constructor Details

    • TokenNameFinderModel

      public TokenNameFinderModel(String languageCode, SequenceClassificationModel<String> nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
      Initializes a TokenNameFinderModel instance via given parameters.
      Parameters:
      languageCode - The ISO conform language code.
      nameFinderModel - A valid MaxentModel.
      generatorDescriptor - The byte[] representing the feature generator descriptor.
      resources - Additional resources in a mapping.
      manifestInfoEntries - Additional information kept in the manifest.
      seqCodec - The SequenceCodec to use.
      factory - The TokenNameFinderFactory for creating related objects.
      Throws:
      IllegalArgumentException - Thrown if the namFinderModel incompatible with seqCodec.
    • TokenNameFinderModel

      public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries, SequenceCodec<String> seqCodec, TokenNameFinderFactory factory)
      Initializes a TokenNameFinderModel instance via given parameters.
      Parameters:
      languageCode - The ISO conform language code.
      nameFinderModel - A valid MaxentModel.
      beamSize - The beam size. Must be greater than 0.
      generatorDescriptor - The byte[] representing the feature generator descriptor.
      resources - Additional resources in a mapping.
      manifestInfoEntries - Additional information kept in the manifest.
      seqCodec - The SequenceCodec to use.
      factory - The TokenNameFinderFactory for creating related objects.
      Throws:
      IllegalArgumentException - Thrown if the namFinderModel incompatible with seqCodec.
    • TokenNameFinderModel

      public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
      Initializes a TokenNameFinderModel instance via given parameters.
      Parameters:
      languageCode - The ISO conform language code.
      nameFinderModel - A valid MaxentModel.
      generatorDescriptor - The byte[] representing the feature generator descriptor.
      resources - Additional resources in a mapping.
      manifestInfoEntries - Additional information kept in the manifest.
      Throws:
      IllegalArgumentException - Thrown if the namFinderModel incompatible with seqCodec.
    • TokenNameFinderModel

      public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, int beamSize, byte[] generatorDescriptor, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
      Initializes a TokenNameFinderModel instance via given parameters.
      Parameters:
      languageCode - The ISO conform language code.
      nameFinderModel - A valid MaxentModel.
      beamSize - The beam size. Must be greater than 0.
      generatorDescriptor - The byte[] representing the feature generator descriptor.
      resources - Additional resources in a mapping.
      manifestInfoEntries - Additional information kept in the manifest.
      Throws:
      IllegalArgumentException - Thrown if the namFinderModel incompatible with seqCodec.
    • TokenNameFinderModel

      public TokenNameFinderModel(String languageCode, MaxentModel nameFinderModel, Map<String,Object> resources, Map<String,String> manifestInfoEntries)
      Initializes a TokenNameFinderModel instance via given parameters.
      Parameters:
      languageCode - The ISO conform language code.
      nameFinderModel - A valid MaxentModel.
      resources - Additional resources in a mapping.
      manifestInfoEntries - Additional information kept in the manifest.
      Throws:
      IllegalArgumentException - Thrown if the nameFinderModel is incompatible with seqCodec.
    • TokenNameFinderModel

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

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

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

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