[Question] How the answers are aggregated (from different documents) ? #2744
-
Hey all, I have a simple question that bugs me a lot... Hope to get some help from the community of Haystack... Context:Benefit from the Haystack library, we are able to use My question will be:
Haystack Thanks in advance for all the advice : ) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @gabinguo in this context I would like to quote the famous saying "A line of code is worth a thousand words." 😉 So I would recommend that you go through the lines of code in the The other method you want to look at is In short, softmax is calculated only for all answers in the same passage and then there is only one more complex trick we do to compare answers from different passages and no_answers in |
Beta Was this translation helpful? Give feedback.
Hi @gabinguo in this context I would like to quote the famous saying "A line of code is worth a thousand words." 😉 So I would recommend that you go through the lines of code in the
logits_to_preds
method of theQuestionAnsweringHead
here:haystack/haystack/modeling/model/prediction_head.py
Line 444 in f7d0047
The other method you want to look at is
aggregate_preds
:haystack/haystack/modeling/model/prediction_head.py
Line 666 in f7d0047
In short, softmax is calculated only for all answers …