public class OnePassRealValueDataIndexer extends Object implements opennlp.model.DataIndexer
| Modifier and Type | Field and Description |
|---|---|
protected int[][] |
contexts
The integer contexts associated with each unique event.
|
protected int[] |
numTimesEventsSeen
The number of times an event occured in the training data.
|
protected String[] |
outcomeLabels
The names of the outcomes.
|
protected int[] |
outcomeList
The integer outcome associated with each unique event.
|
protected int[] |
predCounts
The number of times each predicate occured.
|
protected String[] |
predLabels
The predicate/context names.
|
| Constructor and Description |
|---|
OnePassRealValueDataIndexer(EventStream eventStream,
int cutoff,
boolean sort) |
| Modifier and Type | Method and Description |
|---|---|
int[][] |
getContexts() |
int |
getNumEvents() |
int[] |
getNumTimesEventsSeen() |
String[] |
getOutcomeLabels() |
int[] |
getOutcomeList() |
int[] |
getPredCounts() |
String[] |
getPredLabels() |
float[][] |
getValues() |
protected List<opennlp.model.ComparableEvent> |
index(LinkedList<opennlp.model.Event> events,
Map<String,Integer> predicateIndex) |
protected int |
sortAndMerge(List<opennlp.model.ComparableEvent> eventsToCompare,
boolean sort) |
protected static String[] |
toIndexedStringArray(Map<String,Integer> labelToIndexMap)
Utility method for creating a String[] array from a map whose keys are labels (Strings) to be
stored in the array and whose values are the indices (Integers) at which the corresponding
labels should be inserted.
|
protected static void |
update(String[] ec,
Set<String> predicateSet,
Map<String,Integer> counter,
int cutoff)
Updates the set of predicated and counter with the specified event contexts and cutoff.
|
protected int[][] contexts
protected int[] outcomeList
protected String[] outcomeLabels
protected int[] numTimesEventsSeen
protected String[] predLabels
protected int[] predCounts
public OnePassRealValueDataIndexer(EventStream eventStream, int cutoff, boolean sort)
protected static void update(String[] ec, Set<String> predicateSet, Map<String,Integer> counter, int cutoff)
ec - The contexts/features which occur in a event.predicateSet - The set of predicates which will be used for model building.counter - The predicate counters.cutoff - The cutoff which determines whether a predicate is included.protected int sortAndMerge(List<opennlp.model.ComparableEvent> eventsToCompare, boolean sort)
protected static String[] toIndexedStringArray(Map<String,Integer> labelToIndexMap)
labelToIndexMap - a TObjectIntHashMap valueString[] valueprotected List<opennlp.model.ComparableEvent> index(LinkedList<opennlp.model.Event> events, Map<String,Integer> predicateIndex)
public int getNumEvents()
getNumEvents in interface opennlp.model.DataIndexerpublic int[][] getContexts()
getContexts in interface opennlp.model.DataIndexerpublic int[] getNumTimesEventsSeen()
getNumTimesEventsSeen in interface opennlp.model.DataIndexerpublic int[] getOutcomeList()
getOutcomeList in interface opennlp.model.DataIndexerpublic String[] getPredLabels()
getPredLabels in interface opennlp.model.DataIndexerpublic int[] getPredCounts()
getPredCounts in interface opennlp.model.DataIndexerpublic String[] getOutcomeLabels()
getOutcomeLabels in interface opennlp.model.DataIndexerpublic float[][] getValues()
getValues in interface opennlp.model.DataIndexerCopyright © 2015. All rights reserved.