#include <SimpleKLRetMethod.hpp>
Inheritance diagram for SimpleKLQueryModel:

Public Methods | |
| SimpleKLQueryModel (const TermQuery &qry, const Index &dbIndex) | |
| construct a query model based on query text | |
| SimpleKLQueryModel (const Index &dbIndex) | |
| construct an empty query model | |
| virtual | ~SimpleKLQueryModel () |
| virtual void | interpolateWith (const UnigramLM &qModel, double origModCoeff, int howManyWord, double prSumThresh=1, double prThresh=0) |
| interpolate the model with any (truncated) unigram LM, default parameter to control the truncation is the number of words | |
| virtual double | scoreConstant () const |
| Any query-specific constant term in the scoring formula. | |
| virtual void | load (istream &is) |
| load a query model/rep from input stream is | |
| virtual void | save (ostream &os) |
| save a query model/rep to output stream os | |
| virtual void | clarity (ostream &os) |
| save a query clarity to output stream os | |
| virtual double | clarity () const |
| compute query clarity score | |
| double | colDivergence () const |
| get and compute if necessary query-collection KL-div (useful for recovering the true divergence value from a score) | |
| double | KLDivergence (const UnigramLM &refMod) |
| compute the KL-div of the query model and any unigram LM, i.e.,D(Mq|Mref) | |
| double | colQueryLikelihood () const |
Protected Attributes | |
| double | colQLikelihood |
| double | colKL |
| bool | colKLComputed |
| IndexedRealVector * | qm |
| const Index & | ind |
|
||||||||||||
|
construct a query model based on query text
|
|
|
construct an empty query model
|
|
|
|
|
|
compute query clarity score
|
|
|
save a query clarity to output stream os
|
|
|
get and compute if necessary query-collection KL-div (useful for recovering the true divergence value from a score)
|
|
|
|
|
||||||||||||||||||||||||
|
interpolate the model with any (truncated) unigram LM, default parameter to control the truncation is the number of words
The interpolated model is defined as The "new truncated model" gives a positive probability to all words that "survive" in the truncating process, but gives a zero probability to all others. So, the sum of all word probabilities according to the truncated model does not have to sum to 1. The assumption is that if a word has an extrememly small probability, adding it to the query model will not affect scoring that much.
The truncation procedure is as follows: First, we sort the probabilities in |
|
|
compute the KL-div of the query model and any unigram LM, i.e.,D(Mq|Mref)
|
|
|
load a query model/rep from input stream is
|
|
|
save a query model/rep to output stream os
|
|
|
Any query-specific constant term in the scoring formula.
Reimplemented from ArrayQueryRep. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.18