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

lemur::retrieval::CosSimRetMethod Class Reference

Cosine similarity retrieval method. More...

#include <CosSimRetMethod.hpp>

Inheritance diagram for lemur::retrieval::CosSimRetMethod:

lemur::api::TextQueryRetMethod lemur::api::RetrievalMethod List of all members.

Public Member Functions

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

 CosSimRetMethod (const lemur::api::Index &dbIndex, const string &L2file, lemur::api::ScoreAccumulator &accumulator)
virtual ~CosSimRetMethod ()
virtual lemur::api::TextQueryRepcomputeTextQueryRep (const lemur::api::TermQuery &qry)
virtual lemur::api::TextQueryRepcomputeTextQueryRep (lemur::api::DOCID_T docid)
 compute a query rep for an existing doc

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

virtual lemur::api::ScoreFunctionscoreFunc ()
 return the scoring function pointer

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

void setFeedbackParam (CosSimParameter::FeedbackParam &feedbackParam)

Protected Member Functions

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

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


Protected Attributes

double * idfV
lemur::api::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

lemur::retrieval::CosSimRetMethod::CosSimRetMethod const lemur::api::Index dbIndex,
lemur::api::ScoreAccumulator accumulator
 

Precomputes the idf values for the collection.

lemur::retrieval::CosSimRetMethod::CosSimRetMethod const lemur::api::Index dbIndex,
const string &  L2file,
lemur::api::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.

lemur::retrieval::CosSimRetMethod::~CosSimRetMethod  )  [virtual]
 


Member Function Documentation

virtual lemur::api::DocumentRep* lemur::retrieval::CosSimRetMethod::computeDocRep lemur::api::DOCID_T  docID  )  [inline, virtual]
 

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

Implements lemur::api::TextQueryRetMethod.

virtual lemur::api::TextQueryRep* lemur::retrieval::CosSimRetMethod::computeTextQueryRep lemur::api::DOCID_T  docid  )  [inline, virtual]
 

compute a query rep for an existing doc

Reimplemented from lemur::api::TextQueryRetMethod.

virtual lemur::api::TextQueryRep* lemur::retrieval::CosSimRetMethod::computeTextQueryRep const lemur::api::TermQuery qry  )  [inline, virtual]
 

double lemur::retrieval::CosSimRetMethod::docNorm lemur::api::DOCID_T  docID  )  [protected]
 

compute the L2 norm for a given docID.

void lemur::retrieval::CosSimRetMethod::loadDocNorms  )  [protected]
 

load the precomputed L2 norms support file.

virtual lemur::api::ScoreFunction* lemur::retrieval::CosSimRetMethod::scoreFunc  )  [inline, virtual]
 

return the scoring function pointer

Implements lemur::api::TextQueryRetMethod.

void lemur::retrieval::CosSimRetMethod::setFeedbackParam CosSimParameter::FeedbackParam feedbackParam  )  [inline]
 

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

Use same as TFIDFRetMethod.


Member Data Documentation

double* lemur::retrieval::CosSimRetMethod::docNorms [protected]
 

CosSimParameter::FeedbackParam lemur::retrieval::CosSimRetMethod::fbParam [protected]
 

double* lemur::retrieval::CosSimRetMethod::idfV [protected]
 

const string& lemur::retrieval::CosSimRetMethod::L2FileName [protected]
 

Name of support file containing the precomputed L2 norms.

int lemur::retrieval::CosSimRetMethod::numDocs [protected]
 

int lemur::retrieval::CosSimRetMethod::numTerms [protected]
 

lemur::api::ScoreFunction* lemur::retrieval::CosSimRetMethod::scFunc [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:06 2010 for Lemur by doxygen 1.3.4