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 
13 #include "meta/util/string_view.h"
14 
15 namespace meta
16 {
17 namespace index
18 {
19 
26 {
27  public:
29  const static util::string_view id;
30 
34  float score_one(const score_data& sd) override;
35 
36  float initial_score(const score_data& sd) const override;
37 
42  virtual float smoothed_prob(const score_data& sd) const = 0;
43 
48  virtual float doc_constant(const score_data& sd) const = 0;
49 
53  virtual ~language_model_ranker() = default;
54 };
55 }
56 }
57 
58 #endif
virtual float smoothed_prob(const score_data &sd) const =0
Calculates the smoothed probability of a term.
virtual ~language_model_ranker()=default
Default destructor.
float score_one(const score_data &sd) override
Definition: lm_ranker.cpp:19
Definition: ranker.h:226
virtual float doc_constant(const score_data &sd) const =0
A document-dependent constant.
A non-owning reference to a string.
Definition: string_view.h:51
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retrieval, data mining, and other applications of text processing.
Definition: analyzer.h:25
Scores documents according to one of three different smoothed language model scoring methods describe...
Definition: lm_ranker.h:25
static const util::string_view id
The identifier for this ranker.
Definition: lm_ranker.h:29
A score_data object contains information needed to evaluate a ranking function.
Definition: score_data.h:40
float initial_score(const score_data &sd) const override
Computes the constant contribution to the score of a particular document.
Definition: lm_ranker.cpp:27