RankSample

class lightning_ir.data.data.RankSample(query_id: str, query: str, doc_ids: Sequence[str], docs: Sequence[str], targets: Tensor | None = None, qrels: List[Dict[str, Any]] | None = None)[source]

Bases: object

A sample of ranking data containing a query, a ranked list of documents, and optionally targets and qrels.

Parameters:
  • query_id (str) – Id of the query

  • query – Query text

  • doc_ids (Sequence[str]) – List of document ids

  • docs (Sequence[str]) – List of document texts

  • targets (torch.Tensor, optional) – Optional list of target labels denoting the relevane of a document for the query

  • qrels – Optional list of dictionaries mapping document ids to relevance labels

__init__(query_id: str, query: str, doc_ids: Sequence[str], docs: Sequence[str], targets: Tensor | None = None, qrels: List[Dict[str, Any]] | None = None) None

Methods

__init__(query_id, query, doc_ids, docs[, ...])

Attributes

qrels

targets

query_id

query

doc_ids

docs