(pred_str, strip_double_curly_brace=False)
| 52 | |
| 53 | |
| 54 | def extract_boxed_answer(pred_str, strip_double_curly_brace=False): |
| 55 | boxed_str = last_boxed_only_string(pred_str) |
| 56 | if boxed_str is None: |
| 57 | return None |
| 58 | answer = remove_boxed(boxed_str) |
| 59 | if answer is None: |
| 60 | return None |
| 61 | if strip_double_curly_brace: |
| 62 | match = re.match('^\{(.*)\}$', answer) # noqa: W605 |
| 63 | if match: |
| 64 | answer = match.group(1) |
| 65 | return answer |
| 66 | |
| 67 | |
| 68 | def normalize_final_answer(final_answer: str) -> str: |
no test coverage detected