Package opennlp.tools.ml.model
Interface DataIndexer
-
- All Known Implementing Classes:
AbstractDataIndexer,OnePassDataIndexer,OnePassRealValueDataIndexer,TwoPassDataIndexer
public interface DataIndexerObject which compresses events in memory and performs feature selection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[][]getContexts()Returns the array of predicates seen in each event.intgetNumEvents()Returns the number of total events indexed.int[]getNumTimesEventsSeen()Returns an array indicating the number of times a particular event was seen.String[]getOutcomeLabels()Returns an array of outcome names.int[]getOutcomeList()Returns an array indicating the outcome index for each event.int[]getPredCounts()Returns an array of the count of each predicate in the events.String[]getPredLabels()Returns an array of predicate/context names.float[][]getValues()Returns the values associated with each event context or null if integer values are to be used.voidindex(ObjectStream<Event> eventStream)Performs the data indexing.voidinit(TrainingParameters trainParams, Map<String,String> reportMap)Sets parameters used during the data indexing.
-
-
-
Method Detail
-
getContexts
int[][] getContexts()
Returns the array of predicates seen in each event.- Returns:
- a 2-D array whose first dimension is the event index and array this refers to contains the contexts for that event.
-
getNumTimesEventsSeen
int[] getNumTimesEventsSeen()
Returns an array indicating the number of times a particular event was seen.- Returns:
- an array indexed by the event index indicating the number of times a particular event was seen.
-
getOutcomeList
int[] getOutcomeList()
Returns an array indicating the outcome index for each event.- Returns:
- an array indicating the outcome index for each event.
-
getPredLabels
String[] getPredLabels()
Returns an array of predicate/context names.- Returns:
- an array of predicate/context names indexed by context index. These indices are the
value of the array returned by
getContexts.
-
getPredCounts
int[] getPredCounts()
Returns an array of the count of each predicate in the events.- Returns:
- an array of the count of each predicate in the events.
-
getOutcomeLabels
String[] getOutcomeLabels()
Returns an array of outcome names.- Returns:
- an array of outcome names indexed by outcome index.
-
getValues
float[][] getValues()
Returns the values associated with each event context or null if integer values are to be used.- Returns:
- the values associated with each event context.
-
getNumEvents
int getNumEvents()
Returns the number of total events indexed.- Returns:
- The number of total events indexed.
-
init
void init(TrainingParameters trainParams, Map<String,String> reportMap)
Sets parameters used during the data indexing.- Parameters:
trainParams-TrainingParameters
-
index
void index(ObjectStream<Event> eventStream) throws IOException
Performs the data indexing. Make sure the init(...) method is called first.- Parameters:
eventStream- a stream of events- Throws:
IOException
-
-