TwoPassDataIndexer (Apache OpenNLP :: Core :: ML :: Commons 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.ml.model, class: TwoPassDataIndexer

Package opennlp.tools.ml.model

# Class TwoPassDataIndexer

java.lang.Object
opennlp.tools.ml.model.AbstractDataIndexer<TrainingParameters>
opennlp.tools.ml.model.TwoPassDataIndexer

All Implemented Interfaces:
  `opennlp.tools.ml.model.DataIndexer<TrainingParameters>`

public class TwoPassDataIndexer extends AbstractDataIndexer<TrainingParameters>
Collecting event and context counts by making two passes over the events.

The first pass determines which contexts will be used by the model, and the second pass creates the events in memory containing only the contexts which will be used. This greatly reduces the amount of memory required for storing the events. During the first pass a temporary event file is created which is read during the second pass.

See Also:
  - `DataIndexer`
  - `AbstractDataIndexer`

- ## Field Summary

  ### Fields inherited from class opennlp.tools.ml.model.AbstractDataIndexer

  `SORT_DEFAULT, SORT_PARAM`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TwoPassDataIndexer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `index(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> eventStream)`

  ### Methods inherited from class opennlp.tools.ml.model.AbstractDataIndexer

  `getContexts, getNumEvents, getNumTimesEventsSeen, getOutcomeLabels, getOutcomeList, getPredCounts, getPredLabels, getValues, init`

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

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

- ## Constructor Details

  - ### TwoPassDataIndexer

    public TwoPassDataIndexer()

- ## Method Details

  - ### index

    public void index(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> eventStream) throws IOException
    Throws:
      `IOException`