ModErn Text Analysis
META Enumerates Textual Applications
|
Scores documents according to one of three different smoothed language model scoring methods described in "A Study of Smoothing Methods for Language Models Applied to Ad Hoc Information Retrieval" by Zhai and Lafferty, 2001. More...
#include <lm_ranker.h>
Public Member Functions | |
double | score_one (const score_data &sd) override |
double | initial_score (const score_data &sd) const override |
Computes the constant contribution to the score of a particular document. More... | |
virtual double | smoothed_prob (const score_data &sd) const =0 |
Calculates the smoothed probability of a term. More... | |
virtual double | doc_constant (const score_data &sd) const =0 |
A document-dependent constant. More... | |
virtual | ~language_model_ranker ()=default |
Default destructor. | |
Public Member Functions inherited from meta::index::ranker | |
std::vector< std::pair< doc_id, double > > | score (inverted_index &idx, corpus::document &query, uint64_t num_results=10, const std::function< bool(doc_id d_id)> &filter=[](doc_id){return true;}) |
virtual | ~ranker ()=default |
Default destructor. | |
Static Public Attributes | |
static const std::string | id = "language-model" |
The identifier for this ranker. | |
Scores documents according to one of three different smoothed language model scoring methods described in "A Study of Smoothing Methods for Language Models Applied to Ad Hoc Information Retrieval" by Zhai and Lafferty, 2001.
|
overridevirtual |
sd |
Implements meta::index::ranker.
|
overridevirtual |
Computes the constant contribution to the score of a particular document.
sd | The score_data for the query |
Reimplemented from meta::index::ranker.
|
pure virtual |
Calculates the smoothed probability of a term.
sd |
Implemented in meta::index::jelinek_mercer, meta::index::absolute_discount, and meta::index::dirichlet_prior.
|
pure virtual |
A document-dependent constant.
sd |
Implemented in meta::index::jelinek_mercer, meta::index::absolute_discount, and meta::index::dirichlet_prior.