Share via


BM25Similarity Class

Definition

Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm that includes length normalization (controlled by the 'b' parameter) as well as term frequency saturation (controlled by the 'k1' parameter).

public class BM25Similarity : Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm
public class BM25Similarity : Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm, System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.Indexes.Models.BM25Similarity>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.Indexes.Models.BM25Similarity>
type BM25Similarity = class
    inherit SimilarityAlgorithm
type BM25Similarity = class
    inherit SimilarityAlgorithm
    interface IJsonModel<BM25Similarity>
    interface IPersistableModel<BM25Similarity>
Public Class BM25Similarity
Inherits SimilarityAlgorithm
Public Class BM25Similarity
Inherits SimilarityAlgorithm
Implements IJsonModel(Of BM25Similarity), IPersistableModel(Of BM25Similarity)
Inheritance
BM25Similarity
Implements

Constructors

BM25Similarity()

Initializes a new instance of BM25Similarity.

Properties

B

This property controls how the length of a document affects the relevance score. By default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document.

K1

This property controls the scaling function between the term frequency of each matching terms and the final relevance score of a document-query pair. By default, a value of 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency.

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<BM25Similarity>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<BM25Similarity>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IJsonModel<SimilarityAlgorithm>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

(Inherited from SimilarityAlgorithm)
IJsonModel<SimilarityAlgorithm>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

(Inherited from SimilarityAlgorithm)
IPersistableModel<BM25Similarity>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<BM25Similarity>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<BM25Similarity>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

IPersistableModel<SimilarityAlgorithm>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

(Inherited from SimilarityAlgorithm)
IPersistableModel<SimilarityAlgorithm>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

(Inherited from SimilarityAlgorithm)
IPersistableModel<SimilarityAlgorithm>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

(Inherited from SimilarityAlgorithm)

Applies to