Skip to content

Commit

Permalink
added initial retrieval evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesF99 committed Jul 7, 2024
1 parent 3e5c0d1 commit 58b2842
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions trec_biogen/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Literal, TypeAlias

from ir_measures import Measure
import ir_measures
from ir_measures import Measure, nDCG, P

from trec_biogen.datasets import GenerationDataset, RetrievalDataset
from trec_biogen.modules import GenerationModule, RetrievalModule
Expand All @@ -15,7 +16,9 @@ def evaluate_retrieval_module(
measure: RetrievalMeasure,
) -> float:
# TODO: Implement some useful measures using `ir_measures`, e.g., P@1, nDCG@1, nDCG@3, nDCG@10, etc.
return NotImplemented
qrels = ir_measures.read_trec_qrels(dataset.qrels)
run = module.retrieve("todo")
return measure.calc_aggregate(qrels, run)


GenerationMeasure: TypeAlias = Literal["todo"]
Expand Down

0 comments on commit 58b2842

Please sign in to comment.