For some reason when using the monoT5 reranker class to rerank results from a LuceneSearcher it assigns the same score to every document.
I was able to fix this problem by changing a line in the rescore() method in pygaggle.rerank.transformer.MonoT5 from
for doc, score in zip(batch.documents, batch_log_probs): doc.score = score
to
for i, doc in enumerate(batch.documents): score = batch_log_probs[i] texts[i].score = score
For some reason when using the monoT5 reranker class to rerank results from a LuceneSearcher it assigns the same score to every document.
I was able to fix this problem by changing a line in the rescore() method in pygaggle.rerank.transformer.MonoT5 from
for doc, score in zip(batch.documents, batch_log_probs): doc.score = score
tofor i, doc in enumerate(batch.documents): score = batch_log_probs[i] texts[i].score = score
Full method for reference: