ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
index
ranker
ranker.h
Go to the documentation of this file.
1
9
#ifndef META_RANKER_H_
10
#define META_RANKER_H_
11
12
#include <utility>
13
#include <vector>
14
15
#include "
meta.h
"
16
17
namespace
meta
18
{
19
20
namespace
corpus
21
{
22
class
document;
23
}
24
25
namespace
index
26
{
27
class
inverted_index;
28
struct
score_data;
29
}
30
}
31
32
namespace
meta
33
{
34
namespace
index
35
{
36
41
class
ranker
42
{
43
public
:
51
std::vector<std::pair<doc_id, double>>
52
score
(
inverted_index
& idx,
corpus::document
& query,
53
uint64_t num_results = 10,
54
const
std::function<
bool
(doc_id d_id)>& filter = [](doc_id) {
55
return
true
;
56
});
57
63
virtual
double
score_one
(
const
score_data
& sd) = 0;
64
70
virtual
double
initial_score
(
const
score_data
& sd)
const
;
71
75
virtual
~ranker
() =
default
;
76
77
private
:
79
std::vector<double>
results_
;
80
};
81
}
82
}
83
84
#endif
meta.h
Contains top-level namespace documentation for the META toolkit.
meta::index::ranker::~ranker
virtual ~ranker()=default
Default destructor.
meta::index::inverted_index
The inverted_index class stores information on a corpus indexed by term_ids.
Definition:
inverted_index.h:54
meta::index::ranker
A ranker scores a query against all the documents in an inverted index, returning a list of documents...
Definition:
ranker.h:41
meta::index::ranker::score
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;})
Definition:
ranker.cpp:18
meta::corpus::document
Represents an indexable document.
Definition:
document.h:31
meta
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition:
analyzer.h:24
meta::index::ranker::results_
std::vector< double > results_
results per doc_id
Definition:
ranker.h:79
meta::index::ranker::score_one
virtual double score_one(const score_data &sd)=0
Computes the contribution to the score of a document for a matched query term.
meta::index::score_data
A score_data object contains information needed to evaluate a ranking function.
Definition:
score_data.h:39
meta::index::ranker::initial_score
virtual double initial_score(const score_data &sd) const
Computes the constant contribution to the score of a particular document.
Definition:
ranker.cpp:85
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1