OpenCompass/opencompass/datasets/livemathbench/utils.py
Junnan Liu 8e8d4f1c64
[Feature] Support G-Pass@k and LiveMathBench (#1772)
* support G-Pass@k and livemathbench

* fix bugs

* fix comments of GPassKEvaluator

* update saved details of GPassKEvaluator

* update saved details of GPassKEvaluator

* fix eval api configs & update openai_api for ease of debugging

* update huggingface path

* fix method name of G-Pass@k

* fix default value of eval_model_name

* refactor G-Pass@k evaluator

* log generation params for each backend

* fix evaluation resume

* add notimplementerror
2024-12-30 16:59:39 +08:00

11 lines
189 B
Python

import re
def extract_judge_label(text):
if isinstance(text, str):
match = re.findall(r'\\boxed{(.+?)}', text)
if match:
return match[-1]
return None