ModErn Text Analysis
META Enumerates Textual Applications
lm_ranker.h
Go to the documentation of this file.
1 
9 #ifndef META_LM_RANKER_H_
10 #define META_LM_RANKER_H_
11 
12 #include "index/ranker/ranker.h"
13 
14 namespace meta
15 {
16 namespace index
17 {
18 
25 {
26  public:
28  const static std::string id;
29 
33  double score_one(const score_data& sd) override;
34 
35  double initial_score(const score_data& sd) const override;
36 
41  virtual double smoothed_prob(const score_data& sd) const = 0;
42 
47  virtual double doc_constant(const score_data& sd) const = 0;
48 
52  virtual ~language_model_ranker() = default;
53 };
54 }
55 }
56 
57 #endif
double score_one(const score_data &sd) override
Definition: lm_ranker.cpp:18
A ranker scores a query against all the documents in an inverted index, returning a list of documents...
Definition: ranker.h:41
virtual ~language_model_ranker()=default
Default destructor.
double initial_score(const score_data &sd) const override
Computes the constant contribution to the score of a particular document.
Definition: lm_ranker.cpp:26
static const std::string id
The identifier for this ranker.
Definition: lm_ranker.h:28
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
Scores documents according to one of three different smoothed language model scoring methods describe...
Definition: lm_ranker.h:24
A score_data object contains information needed to evaluate a ranking function.
Definition: score_data.h:39
virtual double doc_constant(const score_data &sd) const =0
A document-dependent constant.
virtual double smoothed_prob(const score_data &sd) const =0
Calculates the smoothed probability of a term.