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

The Okapi BM25 scoring function. More...

#include <okapi_bm25.h>

Inheritance diagram for meta::index::okapi_bm25:
meta::index::ranker

Public Member Functions

 okapi_bm25 (double k1=default_k1, double b=default_b, double k3=default_k3)
 
double score_one (const score_data &sd) override
 
- 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 double initial_score (const score_data &sd) const
 Computes the constant contribution to the score of a particular document. More...
 
virtual ~ranker ()=default
 Default destructor.
 

Static Public Attributes

static const std::string id = "bm25"
 The identifier for this ranker.
 
static const constexpr double default_k1 = 1.2
 Default k1, doc term smoothing.
 
static const constexpr double default_b = 0.75
 Default b, length normalization.
 
static const constexpr double default_k3 = 500.0
 Default k3, query term smoothing.
 

Private Attributes

const double k1_
 Doc term smoothing.
 
const double b_
 Length normalization.
 
const double k3_
 Query term smoothing.
 

Detailed Description

The Okapi BM25 scoring function.

Constructor & Destructor Documentation

meta::index::okapi_bm25::okapi_bm25 ( double  k1 = default_k1,
double  b = default_b,
double  k3 = default_k3 
)
Parameters
k1Doc term smoothing
bLength normalization
k3Query term smoothing

Member Function Documentation

double meta::index::okapi_bm25::score_one ( const score_data sd)
overridevirtual
Parameters
sdscore_data for the current query

Implements meta::index::ranker.


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