(self, raw_text)
| 88 | |
| 89 | @classmethod |
| 90 | def get_answer_choice(self, raw_text): |
| 91 | # Function maps answers to CoQA answer categories |
| 92 | # ~ 1/5 of the CoQA answers are Yes/No |
| 93 | # ~ 2/3 of the CoQA answers are span-based |
| 94 | # (answers overlap with the passage ignoring punctuation and case mismatch) |
| 95 | if raw_text == "unknown": |
| 96 | return "0" |
| 97 | if squad_metrics.normalize_answer(raw_text) == "yes": |
| 98 | return "1" |
| 99 | if squad_metrics.normalize_answer(raw_text) == "no": |
| 100 | return "2" |
| 101 | return "3" # Not a yes/no question |
| 102 | |
| 103 | @staticmethod |
| 104 | def compute_scores(gold_list, pred): |
nothing calls this directly
no outgoing calls
no test coverage detected