QACandidates contain score and confidence fields but only score was used to rank QACandidates so far.
This PR makes ranking QACandidates by score the default but also allows to set use_confidence_scores_for_ranking in QAPredictionHead, which activates ranking
QACandidates by confidence.
I think, it's better to keep both fields, score and confidence in QACandidates instead of dropping one of them entirely. Thereby, we are more flexible and allow backwards compatibility.
A new test case checks that results are ranked as expected with and without setting use_confidence_scores_for_ranking.
QACandidates
containscore
andconfidence
fields but onlyscore
was used to rankQACandidates
so far. This PR makes rankingQACandidates
by score the default but also allows to setuse_confidence_scores_for_ranking
inQAPredictionHead
, which activates rankingQACandidates
byconfidence
.I think, it's better to keep both fields,
score
andconfidence
inQACandidates
instead of dropping one of them entirely. Thereby, we are more flexible and allow backwards compatibility.A new test case checks that results are ranked as expected with and without setting
use_confidence_scores_for_ranking
.closes #808