Section navigation

Public classSealed Bm25LSimilarity

Namespace
Rowles.LeanCorpus.Search.Scoring
Assembly
Rowles.LeanCorpus.dll

BM25L scoring model. Extends BM25 with a delta that is modulated by tf/(1+tf), providing a more nuanced lower-bound correction than the constant delta in BM25+.

Score = idf * (normalised_tf + delta * tf / (1 + tf)).

Default: k1=1.2, b=0.75, delta=0.5.

public sealed class Bm25LSimilarity : ISimilarity
Inheritance
Bm25LSimilarity
Implements

Public constructor Bm25LSimilarity(float, float, float)

Initialises a new instance with the specified BM25L parameters.

Public field Instance

Gets the shared singleton instance with default parameters (k1=1.2, b=0.75, delta=0.5).

Public property RequiresCollectionStatistics

Whether this similarity requires collection-level statistics (total term frequency and total terms in collection) for scoring.

Public method PrecomputeFactors(int, int, float)

Precomputes factors constant for a given term across all documents.

Public method Score(int, int, float, int, int)

Computes the score for a single term occurrence in a document.

Public method ScorePrecomputed(float, float, int, int)

Scores using precomputed factors for hot-path scoring.