(self, doc)
| 50 | return map(self._process_doc, self.dataset["test"]) |
| 51 | |
| 52 | def _process_doc(self, doc): |
| 53 | answer_idx = ["a", "b", "c", "d", "e"].index(doc["correct"]) |
| 54 | choices = [ |
| 55 | c[4:].rstrip(" ,") |
| 56 | for c in re.findall(r"[abcd] \) .*?, |e \) .*?$", doc["options"]) |
| 57 | ] |
| 58 | |
| 59 | out_doc = { |
| 60 | "query": "Question: " + doc["Problem"] + "\nAnswer:", |
| 61 | "choices": choices, |
| 62 | "gold": answer_idx, |
| 63 | } |
| 64 | return out_doc |
| 65 | |
| 66 | def doc_to_text(self, doc): |
| 67 | return doc["query"] |
nothing calls this directly
no outgoing calls
no test coverage detected