Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SimpleKLQueryModel Class Reference

Query model representation for the simple KL divergence model. More...

#include <SimpleKLRetMethod.hpp>

Inheritance diagram for SimpleKLQueryModel:

ArrayQueryRep TextQueryRep QueryRep List of all members.

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
IndexedRealVectorqm
const Indexind

Detailed Description

Query model representation for the simple KL divergence model.


Constructor & Destructor Documentation

SimpleKLQueryModel::SimpleKLQueryModel const TermQuery   qry,
const Index   dbIndex
[inline]
 

construct a query model based on query text

SimpleKLQueryModel::SimpleKLQueryModel const Index   dbIndex [inline]
 

construct an empty query model

virtual SimpleKLQueryModel::~SimpleKLQueryModel   [inline, virtual]
 


Member Function Documentation

double SimpleKLQueryModel::clarity   [virtual]
 

compute query clarity score

void SimpleKLQueryModel::clarity ostream &    os [virtual]
 

save a query clarity to output stream os

double SimpleKLQueryModel::colDivergence   const [inline]
 

get and compute if necessary query-collection KL-div (useful for recovering the true divergence value from a score)

double SimpleKLQueryModel::colQueryLikelihood   const [inline]
 

void SimpleKLQueryModel::interpolateWith const UnigramLM   qModel,
double    origModCoeff,
int    howManyWord,
double    prSumThresh = 1,
double    prThresh = 0
[virtual]
 

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 origModCoeff*p(w|original_model)+(1-origModCoeff*p(w|new_truncated_model).

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 qModel passed in, and then iterate over all the entries. For each entry, we check the stopping condition and add the entry to the existing query model if none of the following stopping conditions is satisfied. If, however, any of the conditions is satisfied, the process will terminate. The three stopping conditions are: (1) We already added howManyWord words. (2) The total sum of probabilities added exceeds the threshold prSumThresh. (3) The probability of the current word is below prThresh.

double SimpleKLQueryModel::KLDivergence const UnigramLM   refMod [inline]
 

compute the KL-div of the query model and any unigram LM, i.e.,D(Mq|Mref)

void SimpleKLQueryModel::load istream &    is [virtual]
 

load a query model/rep from input stream is

void SimpleKLQueryModel::save ostream &    os [virtual]
 

save a query model/rep to output stream os

virtual double SimpleKLQueryModel::scoreConstant   [inline, virtual]
 

Any query-specific constant term in the scoring formula.

Reimplemented from ArrayQueryRep.


Member Data Documentation

double SimpleKLQueryModel::colKL [protected]
 

bool SimpleKLQueryModel::colKLComputed [protected]
 

double SimpleKLQueryModel::colQLikelihood [protected]
 

const Index& SimpleKLQueryModel::ind [protected]
 

IndexedRealVector* SimpleKLQueryModel::qm [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:55 2004 for Lemur Toolkit by doxygen1.2.18