
LMJelinekMercerSimilarity
- Namespace
- Rowles.LeanCorpus.Search.Scoring
- Assembly
- Rowles.LeanCorpus.dll
Language-model similarity with Jelinek-Mercer (linear interpolation) smoothing. Interpolates the document model with the collection model using a coefficient 位.
Score = log((1-位) 路 (tf/|d|) + 位 路 P(t|C)), where P(t|C) = collectionFrequency / totalTermsInCollection.
Default 位 = 0.1.
public sealed class LMJelinekMercerSimilarity : ISimilarity
- Inheritance
-
LMJelinekMercerSimilarity
- Implements
LMJelinekMercerSimilarity(float)
Initialises a new instance with the specified interpolation coefficient 位.
Instance
Gets a shared singleton instance with the default 位 = 0.1.
RequiresCollectionStatistics
Whether this similarity requires collection-level statistics (total term frequency and total terms in collection) for scoring.
PrecomputeFactors(int, int, float)
Precomputes factors constant for a given term across all documents.
PrecomputeLmFactors(int, int, float, long, long)
Precomputes factors including collection-level term statistics for language-model similarities. Default simply delegates to PrecomputeFactors(int, int, float) and sets CollectionProb to 0.
Score(int, int, float, int, int)
Computes the score for a single term occurrence in a document.
ScoreLmPrecomputed(float, float, float, int, int)
Scores using precomputed language-model factors.
Default delegates to ScorePrecomputed(float, float, int, int), ignoring collectionProb.
ScorePrecomputed(float, float, int, int)
Scores using precomputed factors for hot-path scoring.