|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopennlp.tools.util.BeamSearch<T>
public class BeamSearch<T>
Performs k-best search over sequence. This is based on the description in Ratnaparkhi (1998), PhD diss, Univ. of Pennsylvania.
Sequence,
SequenceValidator,
BeamSearchContextGenerator| Constructor Summary | |
|---|---|
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model)
Creates new search object. |
|
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model,
int cacheSize)
|
|
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model,
SequenceValidator<T> validator,
int cacheSize)
|
|
| Method Summary | |
|---|---|
Sequence |
bestSequence(T[] sequence,
Object[] additionalContext)
Returns the best sequence of outcomes based on model for this object. |
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
Object[] additionalContext)
|
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
Object[] additionalContext,
double minSequenceScore)
Returns the best sequence of outcomes based on model for this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model)
size - The size of the beam (k).cg - the context generator for the model.model - the model for assigning probabilities to the sequence outcomes.
public BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model,
int cacheSize)
public BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
opennlp.model.MaxentModel model,
SequenceValidator<T> validator,
int cacheSize)
| Method Detail |
|---|
public Sequence[] bestSequences(int numSequences,
T[] sequence,
Object[] additionalContext)
public Sequence[] bestSequences(int numSequences,
T[] sequence,
Object[] additionalContext,
double minSequenceScore)
numSequences - The maximum number of sequences to be returned.sequence - The input sequence.additionalContext - An Object[] of additional context. This is passed to the context generator blindly with the assumption that the context are appropiate.minSequenceScore - A lower bound on the score of a returned sequence.
public Sequence bestSequence(T[] sequence,
Object[] additionalContext)
sequence - The input sequence.additionalContext - An Object[] of additional context. This is passed to the context generator blindly with the assumption that the context are appropiate.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||