Extract the final numeric answer after '#### ' in the GSM8K answer string.
(doc_answer: str)
| 279 | |
| 280 | |
| 281 | def extract_reference(doc_answer: str) -> str: |
| 282 | """Extract the final numeric answer after '#### ' in the GSM8K answer string.""" |
| 283 | match = re.search(r"####\s*(.+)$", doc_answer) |
| 284 | if match: |
| 285 | return match.group(1).strip() |
| 286 | return doc_answer.strip() |
| 287 | |
| 288 | |
| 289 | def parse_args(): |