|
ModErn Text Analysis
META Enumerates Textual Applications
|
A ranker scores a query against all the documents in an inverted index, returning a list of documents sorted by relevance. More...
#include <ranker.h>
Public Member Functions | |
| std::vector< std::pair< doc_id, double > > | score (inverted_index &idx, corpus::document &query, uint64_t num_results=10, const std::function< bool(doc_id d_id)> &filter=[](doc_id){return true;}) |
| virtual double | score_one (const score_data &sd)=0 |
| Computes the contribution to the score of a document for a matched query term. More... | |
| virtual double | initial_score (const score_data &sd) const |
| Computes the constant contribution to the score of a particular document. More... | |
| virtual | ~ranker ()=default |
| Default destructor. | |
Private Attributes | |
| std::vector< double > | results_ |
| results per doc_id | |
A ranker scores a query against all the documents in an inverted index, returning a list of documents sorted by relevance.
| std::vector< std::pair< doc_id, double > > meta::index::ranker::score | ( | inverted_index & | idx, |
| corpus::document & | query, | ||
| uint64_t | num_results = 10, |
||
| const std::function< bool(doc_id d_id)> & | filter = [](doc_id) { return true; } |
||
| ) |
| idx | The index this ranker is operating on |
| query | The current query |
| num_results | The number of results to return in the vector |
| filter | A filtering function to apply to each doc_id; returns true if the document should be included in results |
|
pure virtual |
Computes the contribution to the score of a document for a matched query term.
| sd | The score_data for this query |
Implemented in meta::index::okapi_bm25, meta::index::pivoted_length, and meta::index::language_model_ranker.
|
virtual |
Computes the constant contribution to the score of a particular document.
| sd | The score_data for the query |
Reimplemented in meta::index::language_model_ranker.
1.8.9.1