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

Implements the Jelinek-Mercer smoothed ranking model. More...

#include <jelinek_mercer.h>

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

Public Member Functions

 jelinek_mercer (double lambda=default_lambda)
 
double smoothed_prob (const score_data &sd) const override
 Calculates the smoothed probability of a term. More...
 
double doc_constant (const score_data &sd) const override
 A document-dependent constant. More...
 
- Public Member Functions inherited from meta::index::language_model_ranker
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 ~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 = "jelinek-mercer"
 The identifier for this ranker.
 
static const constexpr double default_lambda = 0.7
 Default value of lambda.
 
- Static Public Attributes inherited from meta::index::language_model_ranker
static const std::string id = "language-model"
 The identifier for this ranker.
 

Private Attributes

const double lambda_
 the JM parameter
 

Detailed Description

Implements the Jelinek-Mercer smoothed ranking model.

This smoothing method can be viewed as a linear interpolation between the query term probablity and the collection term probability. The model parameter lambda is the weighting of this interpolation.

Constructor & Destructor Documentation

meta::index::jelinek_mercer::jelinek_mercer ( double  lambda = default_lambda)
Parameters
lambda

Member Function Documentation

double meta::index::jelinek_mercer::smoothed_prob ( const score_data sd) const
overridevirtual

Calculates the smoothed probability of a term.

Parameters
sd

Implements meta::index::language_model_ranker.

double meta::index::jelinek_mercer::doc_constant ( const score_data sd) const
overridevirtual

A document-dependent constant.

Parameters
sd

Implements meta::index::language_model_ranker.


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