MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / get_answer_choice

Method get_answer_choice

test/general/lm_eval/tasks/coqa.py:90–101  ·  view source on GitHub ↗
(self, raw_text)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected