Package opennlp.tools.ml

# Class AbstractEventTrainer<P extends opennlp.tools.util.Parameters>

java.lang.Object
opennlp.tools.ml.AbstractTrainer<P>
opennlp.tools.ml.AbstractEventTrainer<P>

All Implemented Interfaces:
  `opennlp.tools.commons.Trainer<P>`, `opennlp.tools.ml.EventTrainer<P>`

public abstract class AbstractEventTrainer<P extends opennlp.tools.util.Parameters> extends AbstractTrainer<P> implements opennlp.tools.ml.EventTrainer<P>
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(P parameters)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract opennlp.tools.ml.model.MaxentModel`
  `doTrain(opennlp.tools.ml.model.DataIndexer<P> indexer)`
  `opennlp.tools.ml.model.DataIndexer<P>`
  `getDataIndexer(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> events)`
  `abstract boolean`
  `isSortAndMerge()`
  `final opennlp.tools.ml.model.MaxentModel`
  `train(opennlp.tools.ml.model.DataIndexer<P> indexer)`
  `final opennlp.tools.ml.model.MaxentModel`
  `train(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> 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(P 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<P extends opennlp.tools.util.Parameters>`

  - ### isSortAndMerge

    public abstract boolean isSortAndMerge()

  - ### getDataIndexer

    public opennlp.tools.ml.model.DataIndexer<P> getDataIndexer(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> events) throws IOException
    Throws:
      `IOException`

  - ### doTrain

    public abstract opennlp.tools.ml.model.MaxentModel doTrain(opennlp.tools.ml.model.DataIndexer<P> indexer) throws IOException
    Throws:
      `IOException`

  - ### train

    public final opennlp.tools.ml.model.MaxentModel train(opennlp.tools.ml.model.DataIndexer<P> indexer) throws IOException
    Specified by:
      `train` in interface `opennlp.tools.ml.EventTrainer<P extends opennlp.tools.util.Parameters>`
    Throws:
      `IOException`

  - ### train

    public final opennlp.tools.ml.model.MaxentModel train(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> events) throws IOException
    Specified by:
      `train` in interface `opennlp.tools.ml.EventTrainer<P extends opennlp.tools.util.Parameters>`
    Throws:
      `IOException`