
TfIdfPivotedSimilarity
- Namespace
- Rowles.LeanCorpus.Search.Scoring
- Assembly
- Rowles.LeanCorpus.dll
Pivoted document length normalisation TF-IDF scoring model (Singhal et al.). Uses a linear interpolation between constant and dl/avgdl instead of 1/sqrt(dl), which penalises long documents less aggressively.
tf = sqrt(tf).
len_norm = 1 / ((1-s) + s * dl/avgdl).
Score = tf * idf * len_norm.
Default: s=0.2.
public sealed class TfIdfPivotedSimilarity : ISimilarity
- Inheritance
-
TfIdfPivotedSimilarity
- Implements
TfIdfPivotedSimilarity(float)
Initialises a new instance with the specified pivoted normalisation slope.
Instance
Gets the shared singleton instance with the default slope (s=0.2).
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.
Score(int, int, float, int, int)
Computes the score for a single term occurrence in a document.
ScorePrecomputed(float, float, int, int)
Scores using precomputed factors for hot-path scoring.