Main Page   Namespace List   Class Hierarchy   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 (TextQuery &qry, Index &dbIndex)
 construct a query model based on query text

 SimpleKLQueryModel (Index &dbIndex)
 construct an empty query model

virtual ~SimpleKLQueryModel ()
virtual void interpolateWith (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 ()
 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 ()
 compute query clarity score

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

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


Protected Attributes

double colKL
bool colKLComputed
IndexedRealVectorqm
Indexind

Detailed Description

Query model representation for the simple KL divergence model.


Constructor & Destructor Documentation

SimpleKLQueryModel::SimpleKLQueryModel TextQuery   qry,
Index   dbIndex
[inline]
 

construct a query model based on query text

SimpleKLQueryModel::SimpleKLQueryModel 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   [inline]
 

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

void SimpleKLQueryModel::interpolateWith 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 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]
 

Index& SimpleKLQueryModel::ind [protected]
 

IndexedRealVector* SimpleKLQueryModel::qm [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Sep 30 14:14:19 2002 for LEMUR by doxygen1.2.18