ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Static Public Attributes | List of all members
meta::index::language_model_ranker Class Referenceabstract

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>

Inheritance diagram for meta::index::language_model_ranker:
meta::index::ranker meta::index::absolute_discount meta::index::dirichlet_prior meta::index::jelinek_mercer

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.
 

Detailed Description

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.

Member Function Documentation

double meta::index::language_model_ranker::score_one ( const score_data sd)
overridevirtual
Parameters
sd

Implements meta::index::ranker.

double meta::index::language_model_ranker::initial_score ( const score_data sd) const
overridevirtual

Computes the constant contribution to the score of a particular document.

Parameters
sdThe score_data for the query

Reimplemented from meta::index::ranker.

virtual double meta::index::language_model_ranker::smoothed_prob ( const score_data sd) const
pure virtual

Calculates the smoothed probability of a term.

Parameters
sd

Implemented in meta::index::jelinek_mercer, meta::index::absolute_discount, and meta::index::dirichlet_prior.

virtual double meta::index::language_model_ranker::doc_constant ( const score_data sd) const
pure virtual

A document-dependent constant.

Parameters
sd

Implemented in meta::index::jelinek_mercer, meta::index::absolute_discount, and meta::index::dirichlet_prior.


The documentation for this class was generated from the following files: