Skip to content

Commit

Permalink
changed exception with ignore identical ids
Browse files Browse the repository at this point in the history
  • Loading branch information
thakur-nandan committed Jun 30, 2022
1 parent 1a1e6ab commit 1d9fe34
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions beir/retrieval/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ def evaluate(qrels: Dict[str, Dict[str, int]],
ignore_identical_ids: bool=True) -> Tuple[Dict[str, float], Dict[str, float], Dict[str, float], Dict[str, float]]:

if ignore_identical_ids:
logging.info('Preprocessing the results to remove identical IDs. This is important for ArguAna and Quora')
logging.info('For evaluation, we ignore identical query and document ids (default), please explicitly set ``ignore_identical_ids=False`` to ignore this.')
popped = []
for qid, rels in results.items():
for pid in list(rels):
if qid == pid:
results[qid].pop(pid)
popped.append(pid)
if len(popped):
logging.info(f'Removed {len(popped)} pairs. Examples: {popped[:3]}')

ndcg = {}
_map = {}
Expand Down

0 comments on commit 1d9fe34

Please sign in to comment.