Package opennlp.tools.util

# Class TrainingParameters

java.lang.Object
opennlp.tools.util.TrainingParameters

All Implemented Interfaces:
  `opennlp.tools.util.Parameters`

public class TrainingParameters extends Object implements opennlp.tools.util.Parameters
Declares and handles default parameters used for or during training models.

- ## Field Summary

  ### Fields inherited from interface opennlp.tools.util.Parameters

  `ALGORITHM_DEFAULT_VALUE, ALGORITHM_PARAM, CUTOFF_DEFAULT_VALUE, CUTOFF_PARAM, ITERATIONS_DEFAULT_VALUE, ITERATIONS_PARAM, THREADS_PARAM, TRAINER_TYPE_PARAM`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TrainingParameters()`
  No-arg constructor to create a default `TrainingParameters` instance.
  `TrainingParameters(InputStream in)`
  `InputStream` based constructor that reads in `TrainingParameters`.
  `TrainingParameters(Map<String,Object> map)`
  Key-value based constructor to apply a `Map` based configuration initialization.
  `TrainingParameters(TrainingParameters trainingParameters)`
  Copy constructor to hand over the config of existing `TrainingParameters`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `algorithm()`
  `String`
  `algorithm(String namespace)`
  `static TrainingParameters`
  `defaultParams()`
  `boolean`
  `getBooleanParameter(String key, boolean defaultValue)`
  `boolean`
  `getBooleanParameter(String namespace, String key, boolean defaultValue)`
  `double`
  `getDoubleParameter(String key, double defaultValue)`
  `double`
  `getDoubleParameter(String namespace, String key, double defaultValue)`
  `int`
  `getIntParameter(String key, int defaultValue)`
  `int`
  `getIntParameter(String namespace, String key, int defaultValue)`
  `Map<String,Object>`
  `getObjectSettings()`
  `Map<String,Object>`
  `getObjectSettings(String namespace)`
  `TrainingParameters`
  `getParameters(String namespace)`
  `String`
  `getStringParameter(String key, String defaultValue)`
  `String`
  `getStringParameter(String namespace, String key, String defaultValue)`
  `void`
  `put(String key, boolean value)`
  `void`
  `put(String key, double value)`
  `void`
  `put(String key, int value)`
  `void`
  `put(String key, String value)`
  `void`
  `put(String namespace, String key, boolean value)`
  `void`
  `put(String namespace, String key, double value)`
  `void`
  `put(String namespace, String key, int value)`
  `void`
  `put(String namespace, String key, String value)`
  `void`
  `putIfAbsent(String key, boolean value)`
  `void`
  `putIfAbsent(String key, double value)`
  `void`
  `putIfAbsent(String key, int value)`
  `void`
  `putIfAbsent(String key, String value)`
  `void`
  `putIfAbsent(String namespace, String key, boolean value)`
  `void`
  `putIfAbsent(String namespace, String key, double value)`
  `void`
  `putIfAbsent(String namespace, String key, int value)`
  `void`
  `putIfAbsent(String namespace, String key, String value)`
  `void`
  `serialize(OutputStream out)`
  `static TrainingParameters`
  `setParams(String[] params)`

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

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

- ## Constructor Details

  - ### TrainingParameters

    public TrainingParameters()
    No-arg constructor to create a default `TrainingParameters` instance.

  - ### TrainingParameters

    public TrainingParameters(TrainingParameters trainingParameters)
    Copy constructor to hand over the config of existing `TrainingParameters`.

  - ### TrainingParameters

    public TrainingParameters(Map<String,Object> map)
    Key-value based constructor to apply a `Map` based configuration initialization.

  - ### TrainingParameters

    public TrainingParameters(InputStream in) throws IOException
    `InputStream` based constructor that reads in `TrainingParameters`.
    Throws:
      `IOException` - Thrown if IO errors occurred.

- ## Method Details

  - ### algorithm

    public String algorithm(String namespace)
    Specified by:
      `algorithm` in interface `opennlp.tools.util.Parameters`

  - ### algorithm

    public String algorithm()
    Specified by:
      `algorithm` in interface `opennlp.tools.util.Parameters`

  - ### getObjectSettings

    public Map<String,Object> getObjectSettings(String namespace)
    Specified by:
      `getObjectSettings` in interface `opennlp.tools.util.Parameters`

  - ### getObjectSettings

    public Map<String,Object> getObjectSettings()
    Specified by:
      `getObjectSettings` in interface `opennlp.tools.util.Parameters`

  - ### getParameters

    public TrainingParameters getParameters(String namespace)
    Parameters:
      `namespace` - The name space to filter or narrow the search space. May be `null`.
    Returns:
      Retrieves `TrainingParameters` which can be passed to the train and validate methods.

  - ### putIfAbsent

    public void putIfAbsent(String namespace, String key, String value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String key, String value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String namespace, String key, int value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String key, int value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String namespace, String key, double value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String key, double value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String namespace, String key, boolean value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### putIfAbsent

    public void putIfAbsent(String key, boolean value)
    Specified by:
      `putIfAbsent` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String namespace, String key, String value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String key, String value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String namespace, String key, int value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String key, int value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String namespace, String key, double value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String key, double value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String namespace, String key, boolean value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### put

    public void put(String key, boolean value)
    Specified by:
      `put` in interface `opennlp.tools.util.Parameters`

  - ### serialize

    public void serialize(OutputStream out) throws IOException
    Specified by:
      `serialize` in interface `opennlp.tools.util.Parameters`
    Throws:
      `IOException`

  - ### getStringParameter

    public String getStringParameter(String key, String defaultValue)
    Specified by:
      `getStringParameter` in interface `opennlp.tools.util.Parameters`

  - ### getStringParameter

    public String getStringParameter(String namespace, String key, String defaultValue)
    Specified by:
      `getStringParameter` in interface `opennlp.tools.util.Parameters`

  - ### getIntParameter

    public int getIntParameter(String key, int defaultValue)
    Specified by:
      `getIntParameter` in interface `opennlp.tools.util.Parameters`

  - ### getIntParameter

    public int getIntParameter(String namespace, String key, int defaultValue)
    Specified by:
      `getIntParameter` in interface `opennlp.tools.util.Parameters`

  - ### getDoubleParameter

    public double getDoubleParameter(String key, double defaultValue)
    Specified by:
      `getDoubleParameter` in interface `opennlp.tools.util.Parameters`

  - ### getDoubleParameter

    public double getDoubleParameter(String namespace, String key, double defaultValue)
    Specified by:
      `getDoubleParameter` in interface `opennlp.tools.util.Parameters`

  - ### getBooleanParameter

    public boolean getBooleanParameter(String key, boolean defaultValue)
    Specified by:
      `getBooleanParameter` in interface `opennlp.tools.util.Parameters`

  - ### getBooleanParameter

    public boolean getBooleanParameter(String namespace, String key, boolean defaultValue)
    Specified by:
      `getBooleanParameter` in interface `opennlp.tools.util.Parameters`

  - ### defaultParams

    public static TrainingParameters defaultParams()
    Returns:
      Retrieves a new `instance` initialized with default values.

  - ### setParams

    public static TrainingParameters setParams(String[] params)
    Parameters:
      `params` - The parameters to additionally apply into the new `instance`.
    Returns:
      Retrieves a new `instance` initialized with given parameter values.