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

CosSimRetMethod Class Reference

Cosine similarity retrieval method. More...

#include <CosSimRetMethod.hpp>

Inheritance diagram for CosSimRetMethod:

TextQueryRetMethod RetrievalMethod List of all members.

Public Methods

 CosSimRetMethod (const Index &dbIndex, ScoreAccumulator &accumulator)
 Precomputes the idf values for the collection.

 CosSimRetMethod (const Index &dbIndex, const string &L2file, ScoreAccumulator &accumulator)
virtual ~CosSimRetMethod ()
virtual TextQueryRepcomputeTextQueryRep (const TermQuery &qry)
 compute the query representation for a text query (caller responsible for deleting the memory of the generated new instance)

virtual TextQueryRepcomputeTextQueryRep (DOCID_T docid)
 compute a query rep for an existing doc

virtual DocumentRepcomputeDocRep (DOCID_T docID)
 compute the doc representation (caller responsible for deleting the memory of the generated new instance)

virtual ScoreFunctionscoreFunc ()
 return the scoring function pointer

virtual void updateTextQuery (TextQueryRep &qryRep, const DocIDSet &relDocs)
 Use same as TFIDFRetMethod.

void setFeedbackParam (CosSimParameter::FeedbackParam &feedbackParam)

Protected Methods

double docNorm (DOCID_T docID)
 compute the L2 norm for a given docID.

void loadDocNorms ()
 load the precomputed L2 norms support file.


Protected Attributes

double * idfV
ScoreFunctionscFunc
double * docNorms
int numDocs
int numTerms
Parameters
CosSimParameter::FeedbackParam fbParam
const string & L2FileName
 Name of support file containing the precomputed L2 norms.


Detailed Description

Cosine similarity retrieval method.


Constructor & Destructor Documentation

CosSimRetMethod::CosSimRetMethod const Index   dbIndex,
ScoreAccumulator   accumulator
 

Precomputes the idf values for the collection.

CosSimRetMethod::CosSimRetMethod const Index   dbIndex,
const string &    L2file,
ScoreAccumulator   accumulator
 

Precomputes the idf values for the collection. Loads the precomputed L2 document norms from L2File (if present). This support file is optional, if it is not found, L2 norms will be computed during scoring and cached across queries.

CosSimRetMethod::~CosSimRetMethod   [virtual]
 


Member Function Documentation

virtual DocumentRep* CosSimRetMethod::computeDocRep DOCID_T    docID [inline, virtual]
 

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

Implements TextQueryRetMethod.

virtual TextQueryRep* CosSimRetMethod::computeTextQueryRep DOCID_T    docid [inline, virtual]
 

compute a query rep for an existing doc

Reimplemented from TextQueryRetMethod.

virtual TextQueryRep* CosSimRetMethod::computeTextQueryRep const TermQuery   qry [inline, virtual]
 

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

Implements TextQueryRetMethod.

double CosSimRetMethod::docNorm DOCID_T    docID [protected]
 

compute the L2 norm for a given docID.

void CosSimRetMethod::loadDocNorms   [protected]
 

load the precomputed L2 norms support file.

virtual ScoreFunction* CosSimRetMethod::scoreFunc   [inline, virtual]
 

return the scoring function pointer

Implements TextQueryRetMethod.

void CosSimRetMethod::setFeedbackParam CosSimParameter::FeedbackParam   feedbackParam [inline]
 

void CosSimRetMethod::updateTextQuery TextQueryRep   qryRep,
const DocIDSet   relDocs
[virtual]
 

Use same as TFIDFRetMethod.

Implements TextQueryRetMethod.


Member Data Documentation

double* CosSimRetMethod::docNorms [protected]
 

CosSimParameter::FeedbackParam CosSimRetMethod::fbParam [protected]
 

double* CosSimRetMethod::idfV [protected]
 

const string& CosSimRetMethod::L2FileName [protected]
 

Name of support file containing the precomputed L2 norms.

int CosSimRetMethod::numDocs [protected]
 

int CosSimRetMethod::numTerms [protected]
 

ScoreFunction* CosSimRetMethod::scFunc [protected]
 


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