Commit 1a28d18f authored by Baber's avatar Baber
Browse files

add custom regex

parent c6259cf7
......@@ -101,6 +101,12 @@ def extract_answer(response: str, problem: dict) -> str:
if response == "":
return ""
### This is not in the original code:
extract = re.findall(r"[tT]he answer is (\d+)", response)
if extract:
return str(extract[0])
###
if question_type == "multi_choice" and response in choices:
return response
......
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