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 CORIRetMethod CosSimRetMethod 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 TextQueryRepcomputeTextQueryRep (int docid)
 compute a query rep for an existing doc (DOCID_T needed).

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 void scoreCollection (int docid, IndexedRealVector &results)
 add support for scoring an existing document against the collection

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.

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

Protected Attributes

ScoreAccumulatorscAcc
DocumentRep ** docReps
 cache document reps.

bool cacheDocReps
 whether or not to cache document representations

int docRepsSize
 number of documents plus 1, the size of the docReps array.


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:

s(q,d) = g(w(q1,d1,q,d) + ... + w(qN,dN,q,d),q,d)
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]
 

Create the retrieval method. If cacheDocReps is true, allocate DocumentRep cache array.

virtual TextQueryRetMethod::~TextQueryRetMethod   [inline, virtual]
 

Destroy the object. If cacheDocReps is true, delete the DocumentRep cache array


Member Function Documentation

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

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

Implemented in CORIRetMethod, CosSimRetMethod, OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

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

overriding abstract class method

Implements RetrievalMethod.

virtual TextQueryRep* TextQueryRetMethod::computeTextQueryRep int    docid [inline, virtual]
 

compute a query rep for an existing doc (DOCID_T needed).

Reimplemented in CosSimRetMethod.

virtual 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)

Implemented in CORIRetMethod, CosSimRetMethod, OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

void TextQueryRetMethod::scoreCollection int    docID,
IndexedRealVector   results
[virtual]
 

add support for scoring an existing document against the collection

czhai

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

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

Reimplemented from RetrievalMethod.

Reimplemented in CORIRetMethod.

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

ooverriding abstract class method

Implements RetrievalMethod.

double TextQueryRetMethod::scoreDocVector TextQueryRep   qry,
int    docID,
FreqVector   docVector
[virtual]
 

virtual ScoreFunction* TextQueryRetMethod::scoreFunc   [pure virtual]
 

return the scoring function pointer

Implemented in CORIRetMethod, CosSimRetMethod, OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.

void TextQueryRetMethod::scoreInvertedIndex QueryRep   qryRep,
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)

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

update the query

Implements RetrievalMethod.

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

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

Implemented in CORIRetMethod, CosSimRetMethod, OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod.


Member Data Documentation

bool TextQueryRetMethod::cacheDocReps [protected]
 

whether or not to cache document representations

DocumentRep** TextQueryRetMethod::docReps [protected]
 

cache document reps.

int TextQueryRetMethod::docRepsSize [protected]
 

number of documents plus 1, the size of the docReps array.

ScoreAccumulator& TextQueryRetMethod::scAcc [protected]
 


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