ModErn Text Analysis
META Enumerates Textual Applications
absolute_discount.h
Go to the documentation of this file.
1 
10 #ifndef META_ABSOLUTE_DISCOUNT_H_
11 #define META_ABSOLUTE_DISCOUNT_H_
12 
13 #include "index/ranker/lm_ranker.h"
15 
16 namespace meta
17 {
18 namespace index
19 {
20 
25 {
26  public:
30  const static std::string id;
31 
35  absolute_discount(double delta = 0.7);
36 
41  double smoothed_prob(const score_data& sd) const override;
42 
47  double doc_constant(const score_data& sd) const override;
48 
49  private:
51  const double delta_;
52 };
53 
58 template <>
59 std::unique_ptr<ranker> make_ranker<absolute_discount>(const cpptoml::table&);
60 }
61 }
62 #endif
absolute_discount(double delta=0.7)
Definition: absolute_discount.cpp:18
std::unique_ptr< ranker > make_ranker< absolute_discount >(const cpptoml::table &)
Specialization of the factory method used to create absolute_discount rankers.
Definition: absolute_discount.cpp:39
double doc_constant(const score_data &sd) const override
A document-dependent constant.
Definition: absolute_discount.cpp:31
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
const double delta_
the absolute discounting parameter
Definition: absolute_discount.h:51
A score_data object contains information needed to evaluate a ranking function.
Definition: score_data.h:39
Implements the absolute discounting smoothing method.
Definition: absolute_discount.h:24
static const std::string id
The identifier of this ranker.
Definition: absolute_discount.h:30
double smoothed_prob(const score_data &sd) const override
Calculates the smoothed probability of a term.
Definition: absolute_discount.cpp:23