Package opennlp.tools.ml.model
Class AbstractDataIndexer
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractDataIndexer
-
- All Implemented Interfaces:
DataIndexer
- Direct Known Subclasses:
OnePassDataIndexer,TwoPassDataIndexer
public abstract class AbstractDataIndexer extends Object implements DataIndexer
AbstractDataIndexerimplementation for collecting event and context counts used in training.- See Also:
DataIndexer
-
-
Field Summary
Fields Modifier and Type Field Description static intCUTOFF_DEFAULTstatic StringCUTOFF_PARAMstatic booleanSORT_DEFAULTstatic StringSORT_PARAM
-
Constructor Summary
Constructors Constructor Description AbstractDataIndexer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[][]getContexts()intgetNumEvents()int[]getNumTimesEventsSeen()String[]getOutcomeLabels()int[]getOutcomeList()int[]getPredCounts()String[]getPredLabels()float[][]getValues()voidinit(TrainingParameters indexingParameters, Map<String,String> reportMap)Sets parameters used during the data indexing.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface opennlp.tools.ml.model.DataIndexer
index
-
-
-
-
Field Detail
-
CUTOFF_PARAM
public static final String CUTOFF_PARAM
- See Also:
- Constant Field Values
-
CUTOFF_DEFAULT
public static final int CUTOFF_DEFAULT
- See Also:
- Constant Field Values
-
SORT_PARAM
public static final String SORT_PARAM
- See Also:
- Constant Field Values
-
SORT_DEFAULT
public static final boolean SORT_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(TrainingParameters indexingParameters, Map<String,String> reportMap)
Sets parameters used during the data indexing.- Specified by:
initin interfaceDataIndexer- Parameters:
indexingParameters- TheTrainingParametersto be used.reportMap- TheMapused for reporting.
-
getContexts
public int[][] getContexts()
- Specified by:
getContextsin 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:
getNumTimesEventsSeenin 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:
getOutcomeListin interfaceDataIndexer- Returns:
- Retrieves an array indicating the outcome index for each event.
-
getPredLabels
public String[] getPredLabels()
- Specified by:
getPredLabelsin 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
public String[] getOutcomeLabels()
- Specified by:
getOutcomeLabelsin interfaceDataIndexer- Returns:
- Retrieves an array of outcome names indexed by outcome index.
-
getPredCounts
public int[] getPredCounts()
- Specified by:
getPredCountsin interfaceDataIndexer- Returns:
- Retrieves an array of the count of each predicate in the events.
-
getNumEvents
public int getNumEvents()
- Specified by:
getNumEventsin interfaceDataIndexer- Returns:
- Retrieves the number of total events indexed.
-
getValues
public float[][] getValues()
- Specified by:
getValuesin interfaceDataIndexer- Returns:
- Retrieves the values associated with each event context or
nullif integer values are to be used.
-
-