Class StupidBackoff

java.lang.Object
org.opensearch.search.suggest.phrase.SmoothingModel
org.opensearch.search.suggest.phrase.StupidBackoff
All Implemented Interfaces:
org.opensearch.core.common.io.stream.NamedWriteable, org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentFragment

public final class StupidBackoff extends SmoothingModel
A "stupid-backoff" smoothing model similar to Katz's Backoff. This model is used as the default if no model is configured.

See N-Gram Smoothing for details.

Opensearch.internal:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent

    org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable

    org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Default discount parameter for StupidBackoff smoothing
    static final String
     

    Fields inherited from interface org.opensearch.core.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    StupidBackoff(double discount)
    Creates a Stupid-Backoff smoothing model.
    StupidBackoff(org.opensearch.core.common.io.stream.StreamInput in)
    Read from a stream.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected boolean
    subtype specific implementation of "equals".
    protected int
     
    fromXContent(org.opensearch.core.xcontent.XContentParser parser)
     
    double
     
     
    protected org.opensearch.core.xcontent.XContentBuilder
    innerToXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params)
     
    void
    writeTo(org.opensearch.core.common.io.stream.StreamOutput out)
     

    Methods inherited from class org.opensearch.search.suggest.phrase.SmoothingModel

    equals, hashCode, toXContent

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opensearch.core.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • StupidBackoff

      public StupidBackoff(double discount)
      Creates a Stupid-Backoff smoothing model.
      Parameters:
      discount - the discount given to lower order ngrams if the higher order ngram doesn't exits
    • StupidBackoff

      public StupidBackoff(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details