Class BeamSearch

java.lang.Object
opennlp.tools.ml.BeamSearch
All Implemented Interfaces:
SequenceClassificationModel

public class BeamSearch extends Object implements SequenceClassificationModel
Performs k-best search over a sequence.

This is based on the description in Ratnaparkhi (1998), PhD diss, Univ. of Pennsylvania.

See Also:
  • Field Details

    • BEAM_SIZE_PARAMETER

      public static final String BEAM_SIZE_PARAMETER
      See Also:
    • EMPTY_ADDITIONAL_CONTEXT

      private static final Object[] EMPTY_ADDITIONAL_CONTEXT
    • size

      protected final int size
    • model

      protected final MaxentModel model
    • probs

      private final double[] probs
    • contextsCache

      private Cache<String[],double[]> contextsCache
    • zeroLog

      private static final int zeroLog
      See Also:
  • Constructor Details

    • BeamSearch

      public BeamSearch(int size, MaxentModel model)
      Initializes a BeamSearch instance.
      Parameters:
      size - The size of the beam (k).
      model - The MaxentModel for assigning probabilities to the sequence outcomes.
    • BeamSearch

      public BeamSearch(int size, MaxentModel model, int cacheSize)
      Initializes a BeamSearch instance.
      Parameters:
      size - The size of the beam (k).
      model - The MaxentModel for assigning probabilities to the sequence outcomes.
      cacheSize - The capacity of the Cache to use.
  • Method Details