-
-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Hi,
I am working a bit with Ranker.rerank() and I noticed the following problem. On this line, the original list of passages is saved as an attribute to the class, and on this line the same list is modified.
Due to the way Python lists are implemented, this means that each time we run rerank() we are actually modifying the original list in loco, and also that the output returned by rerank() is the same input list (at the same memory location). This can lead to multiple hidden behaviours, for instance: if I rerank the same passages on multiple queries sequentially and save the output somewhere, the output from each call is constantly being modified by subsequent calls, with the scores varying.
Is it possible to fix this?
Thanks a lot for your work :)