opennlp.maxent
Class OnePassRealValueDataIndexer

java.lang.Object
  extended by opennlp.maxent.AbstractDataIndexer
      extended by opennlp.maxent.OnePassDataIndexer
          extended by opennlp.maxent.OnePassRealValueDataIndexer
All Implemented Interfaces:
DataIndexer

public class OnePassRealValueDataIndexer
extends OnePassDataIndexer

An indexer 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.

Author:
Tom Morton

Field Summary
 
Fields inherited from class opennlp.maxent.AbstractDataIndexer
contexts, numTimesEventsSeen, outcomeLabels, outcomeList, predCounts, predLabels
 
Constructor Summary
OnePassRealValueDataIndexer(EventStream eventStream, int cutoff)
          Two argument constructor for DataIndexer.
 
Method Summary
 float[][] getValues()
          Returns the values associated with each event context or null if integer values are to be used.
protected  java.util.List index(gnu.trove.TLinkedList events, gnu.trove.TObjectIntHashMap predicateIndex)
           
protected  int sortAndMerge(java.util.List eventsToCompare)
          Sorts and uniques the array of comparable events and return the number of unique events.
 
Methods inherited from class opennlp.maxent.AbstractDataIndexer
getContexts, getNumTimesEventsSeen, getOutcomeLabels, getOutcomeList, getPredCounts, getPredLabels, toIndexedStringArray, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnePassRealValueDataIndexer

public OnePassRealValueDataIndexer(EventStream eventStream,
                                   int cutoff)
Two argument constructor for DataIndexer.

Parameters:
eventStream - An Event[] which contains the a list of all the Events seen in the training data.
cutoff - The minimum number of times a predicate must have been observed in order to be included in the model.
Method Detail

getValues

public float[][] getValues()
Description copied from interface: DataIndexer
Returns the values associated with each event context or null if integer values are to be used.

Specified by:
getValues in interface DataIndexer
Overrides:
getValues in class AbstractDataIndexer
Returns:
the values associated with each event context.

sortAndMerge

protected int sortAndMerge(java.util.List eventsToCompare)
Description copied from class: AbstractDataIndexer
Sorts and uniques the array of comparable events and return the number of unique events. This method will alter the eventsToCompare array -- it does an in place sort, followed by an in place edit to remove duplicates.

Overrides:
sortAndMerge in class AbstractDataIndexer
Parameters:
eventsToCompare - a ComparableEvent[] value
Returns:
The number of unique events in the specified list.

index

protected java.util.List index(gnu.trove.TLinkedList events,
                               gnu.trove.TObjectIntHashMap predicateIndex)
Overrides:
index in class OnePassDataIndexer


Copyright © 2005 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.