ModErn Text Analysis
META Enumerates Textual Applications
|
The Okapi BM25 scoring function. More...
#include <okapi_bm25.h>
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. | |
The Okapi BM25 scoring function.
meta::index::okapi_bm25::okapi_bm25 | ( | double | k1 = default_k1 , |
double | b = default_b , |
||
double | k3 = default_k3 |
||
) |
k1 | Doc term smoothing |
b | Length normalization |
k3 | Query term smoothing |
|
overridevirtual |
sd | score_data for the current query |
Implements meta::index::ranker.