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. More...

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.


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.

SimpleKLQueryModel::~SimpleKLQueryModel ( ) [inline, virtual]
 


Member Function Documentation

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.

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.

double SimpleKLQueryModel::scoreConstant ( ) [inline, virtual]
 

Any query-specific constant term in the scoring formula.

Reimplemented from ArrayQueryRep.


The documentation for this class was generated from the following files:
Generated at Fri Jul 26 18:22:57 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000