-
Notifications
You must be signed in to change notification settings - Fork 72
Question on the QA Evaluator #21
Comments
Yeah you're right that there is no ranking going on in that method. The docstring is wrong. I think the sorting happens on this line inside get_scores instead [k for k, v in sorted(scores.items(), key=lambda item: item[1], reverse=True)] I just had another look at the QAEvaluator model, and it looks like it's just an instance of @torch.no_grad()
def _evaluate_qa(self, encoded_qa_pair: torch.tensor) -> float:
"""Takes an encoded QA pair and returns a score."""
output = self.qae_model(**encoded_qa_pair)
return output[0][0][1]
Looking back on it this was definitely not the best approach. I appear to have trained a binary classification model and then used it as a regression/ranking model for inference. I would probably approach this differently if I were to do it again. |
Hey, thanks for your reposnse. i need this for my thesis |
Hello,
I'm looking at the source code to try to understand it somewhat bc im new to this field. but im stuck at the QA Evaluator.
I don't understand this method
it says it ranks the questions based on the score, but I don't see any sorting based on the score happening.
I also tried debugging the code and it turns out the score doesn't take values between 0 and 1 as I initially anticipated, but rather some arbitrary number. The lowest i found was 2 and the highes was 120+.
So I assumed the higher the score, the more the question and answer match together. However even for questions with score 120 it still sometimes doesnt feel like they match together waaay more than those with a score of ~30-40.
However I could not find any info about this on your readme nor on the huggingface page of the model.
I hope you can maybe give me some insight about the model and the inner workings. Thank you in advance. :)
The text was updated successfully, but these errors were encountered: