#include <TextQueryRetMethod.hpp>
Inheritance diagram for TextQueryRetMethod:
Public Methods | |
TextQueryRetMethod (Index &ind,ScoreAccumulator &accumulator) | |
virtual | ~TextQueryRetMethod () |
virtual TextQueryRep* | computeTextQueryRep (TextQuery &qry)=0 |
compute the query representation for a text query (caller responsible for deleting the memory of the generated new instance). | |
virtual QueryRep* | computeQueryRep (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 DocumentRep* | computeDocRep (int docID)=0 |
compute the doc representation (caller responsible for deleting the memory of the generated new instance). | |
virtual ScoreFunction* | scoreFunc ()=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 | |
ScoreAccumulator& | scAcc |
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.
|
|
|
|
|
compute the doc representation (caller responsible for deleting the memory of the generated new instance).
Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod. |
|
overriding abstract class method.
Reimplemented from RetrievalMethod. |
|
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. |
|
ooverriding abstract class method with a general efficient inverted index scoring procedure.
Reimplemented from RetrievalMethod. |
|
ooverriding abstract class method.
Reimplemented from RetrievalMethod. |
|
|
|
return the scoring function pointer.
Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod. |
|
Efficient scoring with the inverted index. a general scoring procedure shared by many different models (assuming "sortedScores has memory allocated) |
|
update the query.
Reimplemented from RetrievalMethod. |
|
Modify/update the query representation based on a set (presumably) relevant documents.
Reimplemented in OkapiRetMethod, SimpleKLRetMethod, and TFIDFRetMethod. |
|
|