Package opennlp.tools.ml

# Class AbstractEventTrainer

java.lang.Object
opennlp.tools.ml.AbstractTrainer
opennlp.tools.ml.AbstractEventTrainer

All Implemented Interfaces:
  `Trainer`, `EventTrainer`

Direct Known Subclasses:
  `GISTrainer`, `NaiveBayesTrainer`, `PerceptronTrainer`, `QNTrainer`

public abstract class AbstractEventTrainer extends AbstractTrainer implements EventTrainer
A basic `EventTrainer` implementation.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DATA_INDEXER_ONE_PASS_REAL_VALUE`
  `static final String`
  `DATA_INDEXER_ONE_PASS_VALUE`
  `static final String`
  `DATA_INDEXER_PARAM`
  `static final String`
  `DATA_INDEXER_TWO_PASS_VALUE`

  ### Fields inherited from interface opennlp.tools.ml.EventTrainer

  `EVENT_VALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractEventTrainer()`
  `AbstractEventTrainer(TrainingParameters parameters)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract MaxentModel`
  `doTrain(DataIndexer indexer)`
  `DataIndexer`
  `getDataIndexer(ObjectStream<Event> events)`
  `abstract boolean`
  `isSortAndMerge()`
  `final MaxentModel`
  `train(DataIndexer indexer)`
  Trains a `MaxentModel` for given `events`.
  `final MaxentModel`
  `train(ObjectStream<Event> events)`
  Trains a `MaxentModel` for given `events`.
  `void`
  `validate()`
  Checks the configured `parameters`.

  ### Methods inherited from class opennlp.tools.ml.AbstractTrainer

  `getAlgorithm, getCutoff, getIterations, getTrainingConfiguration, init, init`

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

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

  ### Methods inherited from interface opennlp.tools.commons.Trainer

  `init, init`

- ## Field Details

  - ### DATA_INDEXER_PARAM

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

  - ### DATA_INDEXER_ONE_PASS_VALUE

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

  - ### DATA_INDEXER_TWO_PASS_VALUE

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

  - ### DATA_INDEXER_ONE_PASS_REAL_VALUE

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

- ## Constructor Details

  - ### AbstractEventTrainer

    public AbstractEventTrainer()

  - ### AbstractEventTrainer

    public AbstractEventTrainer(TrainingParameters parameters)

- ## Method Details

  - ### validate

    public void validate()
    Description copied from class: `AbstractTrainer`
    Checks the configured `parameters`. If a subclass overrides this, it should call `super.validate();`.
    Overrides:
      `validate` in class `AbstractTrainer`

  - ### isSortAndMerge

    public abstract boolean isSortAndMerge()

  - ### getDataIndexer

    public DataIndexer getDataIndexer(ObjectStream<Event> events) throws IOException
    Throws:
      `IOException`

  - ### doTrain

    public abstract MaxentModel doTrain(DataIndexer indexer) throws IOException
    Throws:
      `IOException`

  - ### train

    public final MaxentModel train(DataIndexer indexer) throws IOException
    Description copied from interface: `EventTrainer`
    Trains a `MaxentModel` for given `events`.
    Specified by:
      `train` in interface `EventTrainer`
    Parameters:
      `indexer` - The input `indexer` to use.
    Returns:
      The trained `MaxentModel`.
    Throws:
      `IOException` - Thrown if IO errors occurred.

  - ### train

    public final MaxentModel train(ObjectStream<Event> events) throws IOException
    Description copied from interface: `EventTrainer`
    Trains a `MaxentModel` for given `events`.
    Specified by:
      `train` in interface `EventTrainer`
    Parameters:
      `events` - The input `events`.
    Returns:
      The trained `MaxentModel`.
    Throws:
      `IOException` - Thrown if IO errors occurred.