diff --git a/src/fast_forward/util/pyterrier.py b/src/fast_forward/util/pyterrier.py index e4365da..e468e41 100644 --- a/src/fast_forward/util/pyterrier.py +++ b/src/fast_forward/util/pyterrier.py @@ -40,10 +40,10 @@ def transform(self, inp: "pd.DataFrame") -> "pd.DataFrame": ) )._df.rename(columns={"q_id": "qid", "id": "docno"}) - result = inp[["qid", "docno", "score"]].merge( - ff_scores[["qid", "docno", "score", "query"]], + result = ff_scores[["qid", "docno", "score", "query"]].merge( + inp[["qid", "docno", "score"]], on=["qid", "docno"], - suffixes=("_0", None), + suffixes=(None, "_0"), ) return pt.model.add_ranks(result, single_query=False)