|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.maxent.AbstractDataIndexer
public abstract class AbstractDataIndexer
Abstract class for collecting event and context counts used in training.
| Field Summary | |
|---|---|
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 java.lang.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 java.lang.String[] |
predLabels
The predicate/context names. |
| Constructor Summary | |
|---|---|
AbstractDataIndexer()
|
|
| Method Summary | |
|---|---|
int[][] |
getContexts()
Returns the array of predicates seen in each event. |
int[] |
getNumTimesEventsSeen()
Returns an array indicating the number of times a particular event was seen. |
java.lang.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. |
java.lang.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. |
protected int |
sortAndMerge(java.util.List eventsToCompare)
Sorts and uniques the array of comparable events and return the number of unique events. |
protected static java.lang.String[] |
toIndexedStringArray(gnu.trove.TObjectIntHashMap 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(java.lang.String[] ec,
java.util.Set predicateSet,
gnu.trove.TObjectIntHashMap counter,
int cutoff)
Updates the set of predicated and counter with the specified event contexts and cutoff. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[][] contexts
protected int[] outcomeList
protected int[] numTimesEventsSeen
protected java.lang.String[] predLabels
protected java.lang.String[] outcomeLabels
protected int[] predCounts
| Constructor Detail |
|---|
public AbstractDataIndexer()
| Method Detail |
|---|
public int[][] getContexts()
DataIndexer
getContexts in interface DataIndexerpublic int[] getNumTimesEventsSeen()
DataIndexer
getNumTimesEventsSeen in interface DataIndexerpublic int[] getOutcomeList()
DataIndexer
getOutcomeList in interface DataIndexerpublic java.lang.String[] getPredLabels()
DataIndexer
getPredLabels in interface DataIndexergetContexts.public java.lang.String[] getOutcomeLabels()
DataIndexer
getOutcomeLabels in interface DataIndexerpublic int[] getPredCounts()
DataIndexer
getPredCounts in interface DataIndexerprotected int sortAndMerge(java.util.List eventsToCompare)
eventsToCompare - a ComparableEvent[] value
protected static void update(java.lang.String[] ec,
java.util.Set predicateSet,
gnu.trove.TObjectIntHashMap 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 static java.lang.String[] toIndexedStringArray(gnu.trove.TObjectIntHashMap labelToIndexMap)
labelToIndexMap - a TObjectIntHashMap value
String[] valuepublic float[][] getValues()
DataIndexer
getValues in interface DataIndexer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||