Skip to content

Commit

Permalink
change order of merge in FFScore to maintain sorted rankings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjleo committed Dec 15, 2024
1 parent ee8b74d commit 83ab446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fast_forward/util/pyterrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 83ab446

Please sign in to comment.