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.


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


Returns all results sorted by score


Returns the number of documents in the result list.

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

Outputs results in TREC format