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

TextQueryRetMethod Class Reference

#include <TextQueryRetMethod.hpp>

Inheritance diagram for TextQueryRetMethod:

RetrievalMethod OkapiRetMethod SimpleKLRetMethod TFIDFRetMethod List of all members.

Public Methods

 TextQueryRetMethod (Index &ind,ScoreAccumulator &accumulator)
virtual ~TextQueryRetMethod ()
virtual TextQueryRepcomputeTextQueryRep (TextQuery &qry)=0
 compute the query representation for a text query (caller responsible for deleting the memory of the generated new instance).

virtual QueryRepcomputeQueryRep (Query &qry)
 overriding abstract class method.

virtual double scoreDoc (QueryRep &qry,int docID)
 ooverriding abstract class method.

virtual void scoreCollection (QueryRep &qry,IndexedRealVector &results)
 ooverriding abstract class method with a general efficient inverted index scoring procedure.

virtual DocumentRepcomputeDocRep (int docID)=0
 compute the doc representation (caller responsible for deleting the memory of the generated new instance).

virtual ScoreFunctionscoreFunc ()=0
 return the scoring function pointer.

virtual void updateQuery (QueryRep &qryRep,DocIDSet &relDocs)
 update the query.

virtual void updateTextQuery (TextQueryRep &qryRep,DocIDSet &relDocs)=0
 Modify/update the query representation based on a set (presumably) relevant documents.

virtual void scoreInvertedIndex (QueryRep &qryRep,IndexedRealVector &scores,bool scoreAll=false)
 Efficient scoring with the inverted index. More...

virtual double scoreDocVector (TextQueryRep &qry,int docID,FreqVector &docVector)

Protected Attributes

ScoreAccumulatorscAcc

Detailed Description

A text query retrieval method is determined by specifying the following elements

Given a query q =(q1,q2,...,qN) and a document d=(d1,d2,...,dN), where q1,...,qN and d1,...,dN are terms, TextQueryRetMethod assumes the following general scoring function:

<blockquote>

s(q,d) = g(w(q1,d1,q,d) + ... + w(qN,dN,q,d),q,d)
</blockquote> That is, the score of a document d against a query q is a function g of the accumulated weight w for each matched term.

The score is thus determined by two functions g and w; both may depend on the whole query or document. The function w gives the weight of each matched term, while the function g makes it possible to perform any further transformation of the sum of the weight of all matched terms based on the "summary" information of a query or a document (e.g., document length).

TextQueryRep, DocumentRep, and ScoreFunction are designed to support this general scoring function in the following way:

A ScoreFunction is responsible for defining the two functions g and w. A TextQueryRep provides any information required for scoring from the query side (e.g., query term frequency). Similarly, a DocumentRep provides any information required for scoring from the document side. Furthermore, a TextQueryRep supports iteration over all query terms, allowing easy accumulation of weights over matched terms. The weighting function w and score adjustment function g typically assume and depend on some particular information and representation of the query and document, so a specific ScoreFunction (for a specific retrieval method) only works for some specific TextQueryRep and DocumentRep that are appropriate for the specific retrieval method.


Constructor & Destructor Documentation

TextQueryRetMethod::TextQueryRetMethod ( Index & ind,
ScoreAccumulator & accumulator ) [inline]
 

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


Member Function Documentation

DocumentRep * TextQueryRetMethod::computeDocRep ( int docID ) [pure virtual]
 

compute the doc representation (caller responsible for deleting the memory of the generated new instance).

Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

QueryRep * TextQueryRetMethod::computeQueryRep ( Query & qry ) [inline, virtual]
 

overriding abstract class method.

Reimplemented from RetrievalMethod.

TextQueryRep * TextQueryRetMethod::computeTextQueryRep ( TextQuery & qry ) [pure virtual]
 

compute the query representation for a text query (caller responsible for deleting the memory of the generated new instance).

Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

void TextQueryRetMethod::scoreCollection ( QueryRep & qry,
IndexedRealVector & results ) [virtual]
 

ooverriding abstract class method with a general efficient inverted index scoring procedure.

Reimplemented from RetrievalMethod.

double TextQueryRetMethod::scoreDoc ( QueryRep & qry,
int docID ) [virtual]
 

ooverriding abstract class method.

Reimplemented from RetrievalMethod.

double TextQueryRetMethod::scoreDocVector ( TextQueryRep & qRep,
int docID,
FreqVector & docVector ) [virtual]
 

ScoreFunction * TextQueryRetMethod::scoreFunc ( ) [pure virtual]
 

return the scoring function pointer.

Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

void TextQueryRetMethod::scoreInvertedIndex ( QueryRep & qRep,
IndexedRealVector & scores,
bool scoreAll = false ) [virtual]
 

Efficient scoring with the inverted index.

a general scoring procedure shared by many different models (assuming "sortedScores has memory allocated)

void TextQueryRetMethod::updateQuery ( QueryRep & qryRep,
DocIDSet & relDocs ) [inline, virtual]
 

update the query.

Reimplemented from RetrievalMethod.

void TextQueryRetMethod::updateTextQuery ( TextQueryRep & qryRep,
DocIDSet & relDocs ) [pure virtual]
 

Modify/update the query representation based on a set (presumably) relevant documents.

Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.


Member Data Documentation

ScoreAccumulator & TextQueryRetMethod::scAcc [protected]
 


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