|
ModErn Text Analysis
META Enumerates Textual Applications
|
Implements Bayesian smoothing with a Dirichlet prior. More...
#include <dirichlet_prior.h>
Public Member Functions | |
| dirichlet_prior (double mu=default_mu) | |
| double | smoothed_prob (const score_data &sd) const override |
| Calculates the smoothed probability of a term. More... | |
| double | doc_constant (const score_data &sd) const override |
| A document-dependent constant. More... | |
Public Member Functions inherited from meta::index::language_model_ranker | |
| double | score_one (const score_data &sd) override |
| double | initial_score (const score_data &sd) const override |
| Computes the constant contribution to the score of a particular document. More... | |
| virtual | ~language_model_ranker ()=default |
| Default destructor. | |
Public Member Functions inherited from meta::index::ranker | |
| std::vector< std::pair< doc_id, double > > | score (inverted_index &idx, corpus::document &query, uint64_t num_results=10, const std::function< bool(doc_id d_id)> &filter=[](doc_id){return true;}) |
| virtual | ~ranker ()=default |
| Default destructor. | |
Static Public Attributes | |
| static const std::string | id = "dirichlet-prior" |
| Identifier for this ranker. | |
| static const constexpr double | default_mu = 2000 |
| Default value of mu. | |
Static Public Attributes inherited from meta::index::language_model_ranker | |
| static const std::string | id = "language-model" |
| The identifier for this ranker. | |
Private Attributes | |
| const double | mu_ |
| the Dirichlet prior parameter | |
Implements Bayesian smoothing with a Dirichlet prior.
| meta::index::dirichlet_prior::dirichlet_prior | ( | double | mu = default_mu | ) |
| mu |
|
overridevirtual |
Calculates the smoothed probability of a term.
| sd | score_data for the current query |
Implements meta::index::language_model_ranker.
|
overridevirtual |
A document-dependent constant.
| sd | score_data for the current query |
Implements meta::index::language_model_ranker.
1.8.9.1