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 (Index &dbIndex, ScoreAccumulator &accumulator)
 Precomputes the idf values for the collection.

 CosSimRetMethod (Index &dbIndex, const char *L2file, ScoreAccumulator &accumulator)
virtual ~CosSimRetMethod ()
virtual TextQueryRepcomputeTextQueryRep (TextQuery &qry)
 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 DocumentRepcomputeDocRep (int 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, DocIDSet &relDocs)
 Use same as TFIDFRetMethod.

void setFeedbackParam (CosSimParameter::FeedbackParam &feedbackParam)

Protected Methods

double docNorm (int 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 char * L2FileName
 Name of support file containing the precomputed L2 norms.


Detailed Description

Cosine similarity retrieval method.


Constructor & Destructor Documentation

CosSimRetMethod::CosSimRetMethod Index   dbIndex,
ScoreAccumulator   accumulator
 

Precomputes the idf values for the collection.

CosSimRetMethod::CosSimRetMethod Index   dbIndex,
const char *    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 int    docID [inline, virtual]
 

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

Implements TextQueryRetMethod.

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

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

Reimplemented from TextQueryRetMethod.

virtual TextQueryRep* CosSimRetMethod::computeTextQueryRep TextQuery   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 int    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,
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 char* 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 Tue Nov 25 11:27:05 2003 for Lemur Toolkit by doxygen1.2.18