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 class for collecting event and context counts used in training.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[][]Returns the array of predicates seen in each event.intReturns the number of total events indexed.int[]Returns an array indicating the number of times a particular event was seen.String[]Returns an array of outcome names.int[]Returns an array indicating the outcome index for each event.int[]Returns an array of the count of each predicate in the events.String[]Returns an array of predicate/context names.float[][]Returns the values associated with each event context or null if integer values are to be used.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, waitMethods inherited from interface opennlp.tools.ml.model.DataIndexer
index
-
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
Description copied from interface:DataIndexerSets parameters used during the data indexing.- Specified by:
initin interfaceDataIndexer- Parameters:
indexingParameters-TrainingParameters
-
getContexts
public int[][] getContexts()Description copied from interface:DataIndexerReturns the array of predicates seen in each event.- Specified by:
getContextsin interfaceDataIndexer- Returns:
- a 2-D array whose first dimension is the event index and array this refers to contains the contexts for that event.
-
getNumTimesEventsSeen
public int[] getNumTimesEventsSeen()Description copied from interface:DataIndexerReturns an array indicating the number of times a particular event was seen.- Specified by:
getNumTimesEventsSeenin interfaceDataIndexer- Returns:
- an array indexed by the event index indicating the number of times a particular event was seen.
-
getOutcomeList
public int[] getOutcomeList()Description copied from interface:DataIndexerReturns an array indicating the outcome index for each event.- Specified by:
getOutcomeListin interfaceDataIndexer- Returns:
- an array indicating the outcome index for each event.
-
getPredLabels
Description copied from interface:DataIndexerReturns an array of predicate/context names.- Specified by:
getPredLabelsin interfaceDataIndexer- Returns:
- an array of predicate/context names indexed by context index. These indices are the
value of the array returned by
getContexts.
-
getOutcomeLabels
Description copied from interface:DataIndexerReturns an array of outcome names.- Specified by:
getOutcomeLabelsin interfaceDataIndexer- Returns:
- an array of outcome names indexed by outcome index.
-
getPredCounts
public int[] getPredCounts()Description copied from interface:DataIndexerReturns an array of the count of each predicate in the events.- Specified by:
getPredCountsin interfaceDataIndexer- Returns:
- an array of the count of each predicate in the events.
-
getNumEvents
public int getNumEvents()Description copied from interface:DataIndexerReturns the number of total events indexed.- Specified by:
getNumEventsin interfaceDataIndexer- Returns:
- The number of total events indexed.
-
getValues
public float[][] getValues()Description copied from interface:DataIndexerReturns the values associated with each event context or null if integer values are to be used.- Specified by:
getValuesin interfaceDataIndexer- Returns:
- the values associated with each event context.
-