nordlys.core.retrieval.retrieval_results module

Retrieval Results

Result list representation.

  • for each hit it holds score and both internal and external doc_ids
Authors:Faegheh Hasibi, Krisztian Balog
class nordlys.core.retrieval.retrieval_results.RetrievalResults(scores={}, query=None)[source]

Bases: object

Class for storing retrieval scores for a given query.

append(doc_id, score)[source]

Adds document to the result list

classmethod elastic_to_retrieval(res, query=None)[source]

Converts elastic search results to retrieval results.

get_score(doc_id)[source]

Returns the score of a document (or None if it’s not in the list).

get_scores_sorted()[source]

Returns all results sorted by score

num_docs()[source]

Returns the number of documents in the result list.

query
write_trec_format(query_id, run_id, out, max_rank=100)[source]

Outputs results in TREC format