ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | List of all members
meta::index::ranking_function Class Referenceabstract
Inheritance diagram for meta::index::ranking_function:
meta::index::ranker meta::index::language_model_ranker meta::index::okapi_bm25 meta::index::pivoted_length meta::index::absolute_discount meta::index::dirichlet_prior meta::index::jelinek_mercer

Public Member Functions

virtual float score_one (const score_data &sd)=0
 Computes the contribution to the score of a document for a matched query term. More...
 
virtual float initial_score (const score_data &sd) const
 Computes the constant contribution to the score of a particular document. More...
 
virtual std::vector< search_resultrank (ranker_context &ctx, uint64_t num_results, const filter_function_type &filter) override final
 Scores a query using a document-at-a-time strategy. More...
 
- Public Member Functions inherited from meta::index::ranker
template<class ForwardIterator , class Function = bool (*)(doc_id)>
std::vector< search_resultscore (inverted_index &idx, ForwardIterator begin, ForwardIterator end, uint64_t num_results=10, Function &&filter=passthrough)
 
std::vector< search_resultscore (inverted_index &idx, const corpus::document &query, uint64_t num_results=10, const filter_function_type &filter=[](doc_id) { return true;})
 
virtual ~ranker ()=default
 Default destructor.
 
virtual void save (std::ostream &out) const =0
 Saves the ranker to a stream. More...
 

Additional Inherited Members

- Public Types inherited from meta::index::ranker
using filter_function_type = std::function< bool(doc_id did)>
 
- Static Public Member Functions inherited from meta::index::ranker
static bool passthrough (doc_id)
 

Member Function Documentation

§ score_one()

virtual float meta::index::ranking_function::score_one ( const score_data sd)
pure virtual

Computes the contribution to the score of a document for a matched query term.

Parameters
sdThe score_data for this query

Implemented in meta::index::okapi_bm25, meta::index::pivoted_length, and meta::index::language_model_ranker.

§ initial_score()

float meta::index::ranking_function::initial_score ( const score_data sd) const
virtual

Computes the constant contribution to the score of a particular document.

Parameters
sdThe score_data for the query

Reimplemented in meta::index::language_model_ranker.

§ rank()

std::vector< search_result > meta::index::ranking_function::rank ( ranker_context ctx,
uint64_t  num_results,
const filter_function_type &  filter 
)
finaloverridevirtual

Scores a query using a document-at-a-time strategy.

You should not override this unless you desire a completely different ranking strategy than document-at-a-time, which might be the case if you are implementing a new pseudo-relevance feedback method.

Parameters
ctxThe ranker_context holding the postings lists
num_resultsThe number of search results to return
filterThe filter function to be used

Implements meta::index::ranker.


The documentation for this class was generated from the following files: