ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
index
ranker
dirichlet_prior.h
Go to the documentation of this file.
1
9
#ifndef META_DIRICHLET_PRIOR_H_
10
#define META_DIRICHLET_PRIOR_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
23
class
dirichlet_prior
:
public
language_model_ranker
24
{
25
public
:
27
const
static
std::string
id
;
28
30
const
static
constexpr
double
default_mu
= 2000;
31
35
dirichlet_prior
(
double
mu = default_mu);
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
mu_
;
52
};
53
58
template
<>
59
std::unique_ptr<ranker>
make_ranker<dirichlet_prior>
(
const
cpptoml::table&);
60
}
61
}
62
#endif
meta::index::dirichlet_prior::dirichlet_prior
dirichlet_prior(double mu=default_mu)
Definition:
dirichlet_prior.cpp:17
meta::index::dirichlet_prior::doc_constant
double doc_constant(const score_data &sd) const override
A document-dependent constant.
Definition:
dirichlet_prior.cpp:30
meta::index::make_ranker< dirichlet_prior >
std::unique_ptr< ranker > make_ranker< dirichlet_prior >(const cpptoml::table &)
Specialization of the factory method used to create dirichlet_prior rankers.
Definition:
dirichlet_prior.cpp:37
ranker_factory.h
meta::index::dirichlet_prior::id
static const std::string id
Identifier for this ranker.
Definition:
dirichlet_prior.h:27
meta::index::dirichlet_prior::default_mu
static const constexpr double default_mu
Default value of mu.
Definition:
dirichlet_prior.h:30
lm_ranker.h
meta::index::dirichlet_prior::mu_
const double mu_
the Dirichlet prior parameter
Definition:
dirichlet_prior.h:51
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::dirichlet_prior::smoothed_prob
double smoothed_prob(const score_data &sd) const override
Calculates the smoothed probability of a term.
Definition:
dirichlet_prior.cpp:22
meta::index::dirichlet_prior
Implements Bayesian smoothing with a Dirichlet prior.
Definition:
dirichlet_prior.h:23
meta::index::score_data
A score_data object contains information needed to evaluate a ranking function.
Definition:
score_data.h:39
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1