public class BeamSearch<T> extends java.lang.Object implements SequenceClassificationModel<T>
Sequence,
SequenceValidator,
BeamSearchContextGenerator| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BEAM_SIZE_PARAMETER |
| Constructor and Description |
|---|
BeamSearch(int size,
MaxentModel model)
Creates new search object.
|
BeamSearch(int size,
MaxentModel model,
int cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
Sequence |
bestSequence(T[] sequence,
java.lang.Object[] additionalContext,
BeamSearchContextGenerator<T> cg,
SequenceValidator<T> validator)
Finds the sequence with the highest probability.
|
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
java.lang.Object[] additionalContext,
BeamSearchContextGenerator<T> cg,
SequenceValidator<T> validator)
Finds the n most probable sequences.
|
Sequence[] |
bestSequences(int numSequences,
T[] sequence,
java.lang.Object[] additionalContext,
double minSequenceScore,
BeamSearchContextGenerator<T> cg,
SequenceValidator<T> validator)
Returns the best sequence of outcomes based on model for this object.
|
java.lang.String[] |
getOutcomes()
Returns all possible outcomes.
|
public static final java.lang.String BEAM_SIZE_PARAMETER
public BeamSearch(int size,
MaxentModel model)
size - The size of the beam (k).model - the model for assigning probabilities to the sequence outcomes.public BeamSearch(int size,
MaxentModel model,
int cacheSize)
public Sequence[] bestSequences(int numSequences, T[] sequence, java.lang.Object[] additionalContext, double minSequenceScore, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator)
bestSequences in interface SequenceClassificationModel<T>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.public Sequence[] bestSequences(int numSequences, T[] sequence, java.lang.Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator)
SequenceClassificationModelbestSequences in interface SequenceClassificationModel<T>public Sequence bestSequence(T[] sequence, java.lang.Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator)
SequenceClassificationModelbestSequence in interface SequenceClassificationModel<T>public java.lang.String[] getOutcomes()
SequenceClassificationModelgetOutcomes in interface SequenceClassificationModel<T>Copyright © 2010 - 2023 Adobe. All Rights Reserved