Commit b07ecab4 authored by Anthony DiPofi's avatar Anthony DiPofi
Browse files

small change to regex

parent 81e42932
...@@ -18,7 +18,7 @@ class MathQA(HFTask, MultipleChoiceTask): ...@@ -18,7 +18,7 @@ class MathQA(HFTask, MultipleChoiceTask):
def _convert_standard(self, doc): def _convert_standard(self, doc):
answer_idx = ['a', 'b', 'c', 'd', 'e'].index(doc['correct']) answer_idx = ['a', 'b', 'c', 'd', 'e'].index(doc['correct'])
choices = [c[4:].rstrip(" ,") for c in re.findall(r"[abcd] \) .*?, |e .*?$", doc['options'])] choices = [c[4:].rstrip(" ,") for c in re.findall(r"[abcd] \) .*?, |e \) .*?$", doc['options'])]
out_doc = { out_doc = {
"query": "Question: " + doc['Problem'] +"\nAnswer:", "query": "Question: " + doc['Problem'] +"\nAnswer:",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment