Class OnePassRealValueDataIndexer
java.lang.Object
opennlp.tools.ml.model.AbstractDataIndexer
opennlp.tools.ml.model.OnePassDataIndexer
opennlp.tools.ml.model.OnePassRealValueDataIndexer
- All Implemented Interfaces:
DataIndexer
A
DataIndexer for maxent model data which handles cutoffs for uncommon
contextual predicates and provides a unique integer index for each of the
predicates and maintains event values.- See Also:
-
Field Summary
FieldsFields inherited from class AbstractDataIndexer
contexts, numTimesEventsSeen, outcomeLabels, outcomeList, predCounts, predLabels, reportMap, SORT_DEFAULT, SORT_PARAM, trainingParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]protected intsortAndMerge(List<ComparableEvent> eventsToCompare, boolean sort) Sorts and uniques the array of comparable events and return the number of unique events.Methods inherited from class OnePassDataIndexer
indexMethods inherited from class AbstractDataIndexer
getContexts, getNumEvents, getNumTimesEventsSeen, getOutcomeLabels, getOutcomeList, getPredCounts, getPredLabels, index, init, toIndexedStringArray, update
-
Field Details
-
values
private float[][] values
-
-
Constructor Details
-
OnePassRealValueDataIndexer
public OnePassRealValueDataIndexer()
-
-
Method Details
-
getValues
public float[][] getValues()- Specified by:
getValuesin interfaceDataIndexer- Overrides:
getValuesin classAbstractDataIndexer- Returns:
- Retrieves the values associated with each event context or
nullif integer values are to be used.
-
sortAndMerge
protected int sortAndMerge(List<ComparableEvent> eventsToCompare, boolean sort) throws InsufficientTrainingDataException Description copied from class:AbstractDataIndexerSorts and uniques the array of comparable events and return the number of unique events. This method will alter theeventsToComparelist.It does an in place sort, followed by an in place edit to remove duplicates.
- Overrides:
sortAndMergein classAbstractDataIndexer- Parameters:
eventsToCompare- TheList<ComparableEvent>events used as input.sort- Whether to use sorting, or not.- Returns:
- The number of unique events in the specified list.
- Throws:
InsufficientTrainingDataException- Thrown if not enough events are provided
-