
Bm25Scorer
- Namespace
- Rowles.LeanCorpus.Search.Scoring
- Assembly
- Rowles.LeanCorpus.dll
BM25 scorer. Computes relevance scores for term matches.
public static class Bm25Scorer
- Inheritance
-
Bm25Scorer
Idf(int, int)
Precomputes the IDF component (constant for a given term across all documents).
NormaliseFieldTermFrequency(float, int, float, float)
Normalises a field term frequency for BM25F-style combined-field scoring before cross-field aggregation.
PrecomputeFactors(int, int, float)
Precomputes factors that are constant for a given field/term. Returns (idf, k1BOverAvgDL) where k1BOverAvgDL = K1 * B / avgDocLength.
Score(int, int, float, int, int)
Computes the BM25 score for a single term in a single document.
ScoreCombinedWithIdf(float, float)
Scores a BM25F-style pseudo term frequency using a precomputed IDF.
ScorePrecomputed(float, float, int, int)
Scores with precomputed IDF and normalisation factor. Avoids per-doc division.
ScorePrecomputedBatch(float, float, ReadOnlySpan<int>, ReadOnlySpan<int>, Span<float>)
Scores multiple documents at once using SIMD for a shared IDF term.