|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.util.BeamSearch
public class BeamSearch
Performs k-best search over sequence. This is based on the description in Ratnaparkhi (1998), PhD diss, Univ. of Pennsylvania.
| Field Summary | |
|---|---|
protected BeamSearchContextGenerator |
cg
|
protected opennlp.maxent.MaxentModel |
model
|
protected int |
size
|
| Constructor Summary | |
|---|---|
BeamSearch(int size,
BeamSearchContextGenerator cg,
opennlp.maxent.MaxentModel model)
Creates new search object. |
|
BeamSearch(int size,
BeamSearchContextGenerator cg,
opennlp.maxent.MaxentModel model,
int cacheSize)
|
|
| Method Summary | |
|---|---|
Sequence |
bestSequence(java.util.List sequence,
java.lang.Object[] additionalContext)
Returns the best sequence of outcomes based on model for this object. |
Sequence |
bestSequence(java.lang.Object[] sequence,
java.lang.Object[] additionalContext)
Returns the best sequence of outcomes based on model for this object. |
Sequence[] |
bestSequences(int numSequences,
java.lang.Object[] sequence,
java.lang.Object[] additionalContext)
|
Sequence[] |
bestSequences(int numSequences,
java.lang.Object[] sequence,
java.lang.Object[] additionalContext,
double minSequenceScore)
Returns the best sequence of outcomes based on model for this object. |
protected boolean |
validSequence(int i,
java.lang.Object[] inputSequence,
java.lang.String[] outcomesSequence,
java.lang.String outcome)
Determines whether a particular continuation of a sequence is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected opennlp.maxent.MaxentModel model
protected BeamSearchContextGenerator cg
protected int size
| Constructor Detail |
|---|
public BeamSearch(int size,
BeamSearchContextGenerator cg,
opennlp.maxent.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 cg,
opennlp.maxent.MaxentModel model,
int cacheSize)
| Method Detail |
|---|
public Sequence[] bestSequences(int numSequences,
java.lang.Object[] sequence,
java.lang.Object[] additionalContext)
public Sequence[] bestSequences(int numSequences,
java.lang.Object[] 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(java.util.List 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.
public Sequence bestSequence(java.lang.Object[] 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.
protected boolean validSequence(int i,
java.lang.Object[] inputSequence,
java.lang.String[] outcomesSequence,
java.lang.String outcome)
i - The index in the input sequence for which the new outcome is being proposed.inputSequence - The input sequence.outcomesSequence - The outcomes so far in this sequence.outcome - The next proposed outcome for the outcomes sequence.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||