Package opennlp.tools.ml.model
Class AbstractDataIndexer
java.lang.Object
opennlp.tools.ml.model.AbstractDataIndexer
- All Implemented Interfaces:
DataIndexer
- Direct Known Subclasses:
OnePassDataIndexer
,TwoPassDataIndexer
Abstract
DataIndexer
implementation for collecting
event and context counts used in training.- See Also:
-
Field Details
-
CUTOFF_PARAM
- See Also:
-
CUTOFF_DEFAULT
public static final int CUTOFF_DEFAULT- See Also:
-
SORT_PARAM
- See Also:
-
SORT_DEFAULT
public static final boolean SORT_DEFAULT- See Also:
-
-
Constructor Details
-
AbstractDataIndexer
public AbstractDataIndexer()
-
-
Method Details
-
init
Sets parameters used during the data indexing.- Specified by:
init
in interfaceDataIndexer
- Parameters:
indexingParameters
- TheTrainingParameters
to be used.reportMap
- TheMap
used for reporting.
-
getContexts
public int[][] getContexts()- Specified by:
getContexts
in interfaceDataIndexer
- Returns:
- Retrieves a 2-dimensional array whose first dimension is the event index and array this refers to contains the contexts for that event.
-
getNumTimesEventsSeen
public int[] getNumTimesEventsSeen()- Specified by:
getNumTimesEventsSeen
in interfaceDataIndexer
- Returns:
- Retrieves an array indexed by the event index indicating the number of times a particular event was seen.
-
getOutcomeList
public int[] getOutcomeList()- Specified by:
getOutcomeList
in interfaceDataIndexer
- Returns:
- Retrieves an array indicating the outcome index for each event.
-
getPredLabels
- Specified by:
getPredLabels
in interfaceDataIndexer
- Returns:
- Retrieves an array of predicate/context names indexed by context index.
These indices are the value of the array returned by
DataIndexer.getContexts()
.
-
getOutcomeLabels
- Specified by:
getOutcomeLabels
in interfaceDataIndexer
- Returns:
- Retrieves an array of outcome names indexed by outcome index.
-
getPredCounts
public int[] getPredCounts()- Specified by:
getPredCounts
in interfaceDataIndexer
- Returns:
- Retrieves an array of the count of each predicate in the events.
-
getNumEvents
public int getNumEvents()- Specified by:
getNumEvents
in interfaceDataIndexer
- Returns:
- Retrieves the number of total events indexed.
-
getValues
public float[][] getValues()- Specified by:
getValues
in interfaceDataIndexer
- Returns:
- Retrieves the values associated with each event context or
null
if integer values are to be used.
-