public class BeamSearch<T>
extends java.lang.Object
Sequence
,
SequenceValidator
,
BeamSearchContextGenerator
Constructor and Description |
---|
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
MaxentModel model)
Creates new search object.
|
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
MaxentModel model,
int cacheSize) |
BeamSearch(int size,
BeamSearchContextGenerator<T> cg,
MaxentModel model,
SequenceValidator<T> validator,
int cacheSize) |
Modifier and Type | Method and Description |
---|---|
Sequence |
bestSequence(T[] sequence,
java.lang.Object[] additionalContext)
Returns the best sequence of outcomes based on model for this object.
|
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
java.lang.Object[] additionalContext) |
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
java.lang.Object[] additionalContext,
double minSequenceScore)
Returns the best sequence of outcomes based on model for this object.
|
public BeamSearch(int size, BeamSearchContextGenerator<T> cg, 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, MaxentModel model, int cacheSize)
public BeamSearch(int size, BeamSearchContextGenerator<T> cg, MaxentModel model, SequenceValidator<T> validator, int cacheSize)
public Sequence[] bestSequences(int numSequences, T[] sequence, java.lang.Object[] additionalContext)
public Sequence[] bestSequences(int numSequences, T[] sequence, java.lang.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, java.lang.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.Copyright © 2010 - 2020 Adobe. All Rights Reserved