Package opennlp.tools.ml
Klasse BeamSearch
java.lang.Object
opennlp.tools.ml.BeamSearch
- Alle implementierten Schnittstellen:
SequenceClassificationModel
Performs k-best search over a sequence.
This is based on the description in Ratnaparkhi (1998), PhD diss, Univ. of Pennsylvania.
- Siehe auch:
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungBeamSearch(int size, MaxentModel model) Initializes aBeamSearchinstance.BeamSearch(int size, MaxentModel model, int cacheSize) Initializes aBeamSearchinstance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<T> SequencebestSequence(T[] sequence, Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.<T> Sequence[]bestSequences(int numSequences, T[] sequence, Object[] additionalContext, double minSequenceScore, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.<T> Sequence[]bestSequences(int numSequences, T[] sequence, Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.String[]
-
Felddetails
-
BEAM_SIZE_PARAMETER
- Siehe auch:
-
-
Konstruktordetails
-
BeamSearch
Initializes aBeamSearchinstance.- Parameter:
size- The size of the beam (k).model- TheMaxentModelfor assigning probabilities to the sequence outcomes.
-
BeamSearch
Initializes aBeamSearchinstance.- Parameter:
size- The size of the beam (k).model- TheMaxentModelfor assigning probabilities to the sequence outcomes.cacheSize- The capacity of theCacheto use.
-
-
Methodendetails
-
bestSequences
public <T> Sequence[] bestSequences(int numSequences, T[] sequence, Object[] additionalContext, double minSequenceScore, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.- Angegeben von:
bestSequencesin SchnittstelleSequenceClassificationModel- Parameter:
numSequences- The number of sequences.sequence- The inputBeamSearchsequence.additionalContext- AnObjectof additional context. This is passed to the context generator blindly with the assumption that the context are appropriate.minSequenceScore- The minimum sequence score to use.cg- Thecontext generatorto use.validator- TheSequenceValidatorto validate sequences.- Gibt zurück:
- The top ranked
Sequenceof outcomes ornullif no sequence could be found.
-
bestSequences
public <T> Sequence[] bestSequences(int numSequences, T[] sequence, Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.- Angegeben von:
bestSequencesin SchnittstelleSequenceClassificationModel- Parameter:
numSequences- The number of sequences.sequence- The inputBeamSearchsequence.additionalContext- AnObjectof additional context. This is passed to the context generator blindly with the assumption that the context are appropriate.cg- Thecontext generatorto use.validator- TheSequenceValidatorto validate sequences.- Gibt zurück:
- The top ranked
Sequenceof outcomes ornullif no sequence could be found.
-
bestSequence
public <T> Sequence bestSequence(T[] sequence, Object[] additionalContext, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) Computes the best sequence of outcomes based on theMaxentModel.- Angegeben von:
bestSequencein SchnittstelleSequenceClassificationModel- Parameter:
sequence- The inputBeamSearchsequence.additionalContext- AnObjectof additional context. This is passed to the context generator blindly with the assumption that the context are appropriate.cg- Thecontext generatorto use.validator- TheSequenceValidatorto validate sequences.- Gibt zurück:
- The top ranked
Sequenceof outcomes ornullif no sequence could be found.
-
getOutcomes
- Angegeben von:
getOutcomesin SchnittstelleSequenceClassificationModel- Gibt zurück:
- Retrieves all possible outcomes.
-