
TfIdfAugmentedSimilarity
- Namespace
- Rowles.LeanCorpus.Search.Scoring
- Assembly
- Rowles.LeanCorpus.dll
Augmented TF-IDF scoring model. Uses a pivoted term frequency that reduces the impact of high-TF terms within a document. The parameter K controls the pivot point.
tf_aug = K + (1-K) * tf / (tf + K).
len_norm = 1 / sqrt(dl).
Score = tf_aug * idf * len_norm.
Default: K=0.5.
public sealed class TfIdfAugmentedSimilarity : ISimilarity
- Inheritance
-
TfIdfAugmentedSimilarity
- Implements
TfIdfAugmentedSimilarity(float)
Initialises a new instance with the specified pivot parameter K.
Instance
Gets the shared singleton instance with the default pivot (K=0.5).
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.