ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
index
ranker
jelinek_mercer.h
Go to the documentation of this file.
1
9
#ifndef META_JELINEK_MERCER_H_
10
#define META_JELINEK_MERCER_H_
11
12
#include "
index/ranker/lm_ranker.h
"
13
#include "
index/ranker/ranker_factory.h
"
14
15
namespace
meta
16
{
17
namespace
index
18
{
19
26
class
jelinek_mercer
:
public
language_model_ranker
27
{
28
public
:
30
const
static
std::string
id
;
31
33
const
static
constexpr
double
default_lambda
= 0.7;
34
38
jelinek_mercer
(
double
lambda = default_lambda);
39
44
double
smoothed_prob
(
const
score_data
& sd)
const override
;
45
50
double
doc_constant
(
const
score_data
& sd)
const override
;
51
52
private
:
54
const
double
lambda_
;
55
};
56
61
template
<>
62
std::unique_ptr<ranker>
make_ranker<jelinek_mercer>
(
const
cpptoml::table&);
63
}
64
}
65
66
#endif
meta::index::make_ranker< jelinek_mercer >
std::unique_ptr< ranker > make_ranker< jelinek_mercer >(const cpptoml::table &)
Specialization of the factory method used to create jelinek_mercer rankers.
Definition:
jelinek_mercer.cpp:37
meta::index::jelinek_mercer::smoothed_prob
double smoothed_prob(const score_data &sd) const override
Calculates the smoothed probability of a term.
Definition:
jelinek_mercer.cpp:22
ranker_factory.h
meta::index::jelinek_mercer::default_lambda
static const constexpr double default_lambda
Default value of lambda.
Definition:
jelinek_mercer.h:33
lm_ranker.h
meta
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
meta::index::language_model_ranker
Scores documents according to one of three different smoothed language model scoring methods describe...
Definition:
lm_ranker.h:24
meta::index::jelinek_mercer::doc_constant
double doc_constant(const score_data &sd) const override
A document-dependent constant.
Definition:
jelinek_mercer.cpp:30
meta::index::jelinek_mercer
Implements the Jelinek-Mercer smoothed ranking model.
Definition:
jelinek_mercer.h:26
meta::index::score_data
A score_data object contains information needed to evaluate a ranking function.
Definition:
score_data.h:39
meta::index::jelinek_mercer::lambda_
const double lambda_
the JM parameter
Definition:
jelinek_mercer.h:54
meta::index::jelinek_mercer::id
static const std::string id
The identifier for this ranker.
Definition:
jelinek_mercer.h:30
meta::index::jelinek_mercer::jelinek_mercer
jelinek_mercer(double lambda=default_lambda)
Definition:
jelinek_mercer.cpp:17
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1