|
|
|
from typing import Literal |
|
|
|
AGG_SCORE_METRICS_TYPE = Literal["agg_score_metrics", "agg_score_metrics_prob_raw", "agg_score_metrics_acc"] |
|
|
|
agg_score_metrics_dict_prob = { |
|
"ar": [ |
|
'custom|alghafa:mcq_exams_test_ar|0/prob_norm_token', |
|
'custom|alghafa:meta_ar_msa|0/prob_norm', |
|
'custom|alghafa:multiple_choice_grounded_statement_soqal_task|0/prob_norm_token', |
|
'custom|arabic_mmlu_native:_average|0/prob_norm_pmi', |
|
'custom|arc_easy_ar|0/prob_norm_token', |
|
'custom|hellaswag-ar|0/prob_norm_token', |
|
'custom|mlqa-ar|0/qa_ar_f1', |
|
'custom|piqa_ar|0/prob_norm_token', |
|
'custom|race_ar|0/prob_norm_token', |
|
'custom|sciq_ar|0/prob_norm_token', |
|
'custom|tydiqa-ar|0/qa_ar_f1', |
|
'custom|x-codah-ar|0/prob_norm_token', |
|
'custom|x-csqa-ar|0/prob_norm_pmi', |
|
'custom|xnli-2.0-bool-v2-ar|0/prob', |
|
'custom|arcd|0/qa_ar_f1', |
|
'custom|xstory_cloze-ar|0/prob_norm_token' |
|
], |
|
"fr": [ |
|
'custom|belebele-fr|0/prob_norm_token', |
|
'custom|fquadv2|0/qa_fr_f1', |
|
'custom|french-hellaswag|0/prob_norm_token', |
|
'custom|mintaka-fr|0/qa_fr_f1', |
|
'custom|meta_mmlu-fr:_average|0/prob_norm_pmi', |
|
'custom|x-codah-fr|0/prob_norm_token', |
|
'custom|x-csqa-fr|0/prob_norm_pmi', |
|
'custom|xnli-2.0-bool-v2-fr|0/prob', |
|
'custom|arc-fr|0/prob_norm_pmi' |
|
], |
|
"hi": [ |
|
'custom|belebele-hi|0/prob_norm_token', |
|
'custom|hellaswag-hi|0/prob_norm_token', |
|
'custom|hi-arc:easy|0/arc_norm_token', |
|
'custom|indicqa.hi|0/qa_hi_f1', |
|
'custom|meta_mmlu-hi:_average|0/prob_norm_pmi', |
|
'custom|x-codah-hi|0/prob_norm_token', |
|
'custom|x-csqa-hi|0/prob_norm_pmi', |
|
'custom|xcopa-hi|0/prob_norm_token', |
|
'custom|indicnxnli-hi-bool-v2-hi|0/prob_norm_token', |
|
'custom|xstory_cloze-hi|0/prob_norm_token' |
|
], |
|
"ru": [ |
|
'custom|arc-ru|0/prob_norm_pmi', |
|
'custom|belebele-ru|0/prob_norm_token', |
|
'custom|hellaswag-ru|0/prob_norm_token', |
|
'custom|parus|0/prob_norm_token', |
|
'custom|rummlu:_average|0/prob_norm_pmi', |
|
'custom|ruopenbookqa|0/prob_norm_token', |
|
'custom|tydiqa-ru|0/qa_ru_f1', |
|
'custom|x-codah-ru|0/prob_norm_token', |
|
'custom|x-csqa-ru|0/prob_norm_pmi', |
|
'custom|xnli-2.0-bool-v2-ru|0/prob', |
|
'custom|sber_squad|0/qa_ru_f1', |
|
'custom|xstory_cloze-ru|0/prob_norm_token', |
|
'custom|xquad-ru|0/qa_ru_f1' |
|
], |
|
"sw": [ |
|
'custom|belebele-sw|0/prob_norm_token', |
|
'custom|arc-sw:easy|0/prob_norm_token', |
|
'custom|kenswquad|0/qa_sw_f1', |
|
'custom|tydiqa-sw|0/qa_sw_f1', |
|
'custom|m3exam-sw|0/prob_norm_token', |
|
'custom|x-csqa-sw|0/prob_norm_pmi', |
|
'custom|xcopa-sw|0/prob_norm_token', |
|
'custom|xnli-2.0-bool-v2-sw|0/prob_norm', |
|
'custom|xstory_cloze-sw|0/prob_norm_token' |
|
], |
|
"te": [ |
|
'custom|belebele-te|0/prob_norm_token', |
|
'custom|custom_hellaswag-te|0/prob_norm_token', |
|
'custom|indicqa.te|0/qa_te_f1', |
|
'custom|mmlu-te:_average|0/prob_norm_token', |
|
'custom|indicnxnli-te-bool-v2-te|0/prob_norm_token', |
|
'custom|xcopa-te|0/prob_norm_token', |
|
'custom|xstory_cloze-te|0/prob_norm_token' |
|
], |
|
"th": [ |
|
'custom|belebele-th|0/prob_norm_token', |
|
'custom|m3exam-th|0/prob_norm_token', |
|
'custom|meta_mmlu-th:_average|0/prob_norm_pmi', |
|
'custom|xnli-2.0-bool-v2-th|0/prob', |
|
'custom|custom_hellaswag-th|0/prob_norm_token', |
|
'custom|thaiqa|0/qa_th_f1', |
|
'custom|xquad-th|0/qa_th_f1', |
|
], |
|
"tr": [ |
|
'custom|arc-v2-tr|0/prob_norm', |
|
'custom|belebele-tr|0/prob_norm', |
|
'custom|exams-tr:_average|0/prob_norm', |
|
'custom|hellaswag-tr|0/prob_norm', |
|
'custom|mmlu-tr:_average|0/prob_norm_pmi', |
|
'custom|tqduad2|0/qa_tr_f1', |
|
'custom|xcopa-tr|0/prob_norm', |
|
'custom|xnli-2.0-bool-v2-tr|0/prob', |
|
'custom|xquad-tr|0/qa_tr_f1' |
|
], |
|
"zh": [ |
|
'custom|agieval_NEW_LINE:_average|0/prob_norm_pmi', |
|
'custom|belebele-zh|0/prob_norm_token', |
|
'custom|c3|0/prob_norm_token', |
|
'custom|ceval_NEW_LINE:_average|0/prob_norm_token', |
|
'custom|cmmlu:_average|0/prob_norm_token', |
|
'custom|cmrc|0/qa_zh_f1', |
|
'custom|hellaswag-zh|0/prob_norm_token', |
|
'custom|m3exam-zh|0/prob_norm_token', |
|
'custom|mlqa-zh|0/qa_zh_f1', |
|
'custom|x-codah-zh|0/prob_norm_token', |
|
'custom|x-csqa-zh|0/prob_norm_pmi', |
|
'custom|xcopa-zh|0/prob_norm_token', |
|
'custom|ocnli-bool-v2-zh|0/prob', |
|
'custom|chinese-squad|0/qa_zh_f1', |
|
'custom|xstory_cloze-zh|0/prob_norm_token', |
|
'custom|xwinograd-zh|0/prob_norm_token' |
|
] |
|
} |
|
|
|
|
|
def transform_for_prob_raw(metric: str): |
|
|
|
|
|
splitted_metric = metric.split("/") |
|
|
|
|
|
if not "prob" in splitted_metric[-1]: |
|
return metric |
|
return "/".join(splitted_metric[:-1] + ["prob_raw_norm_token"]) |
|
|
|
|
|
|
|
|
|
agg_score_metrics_dict_prob_raw = { |
|
lang: [transform_for_prob_raw(metric) for metric in metrics] |
|
for lang, metrics in agg_score_metrics_dict_prob.items() |
|
} |
|
|
|
agg_score_metrics_dict_acc = { |
|
lang: [metric.replace("/prob", "/acc") for metric in metrics] |
|
for lang, metrics in agg_score_metrics_dict_prob.items() |
|
} |
|
|
|
agg_score_metrics_dict_both = { |
|
lang: agg_score_metrics_dict_prob[lang] + agg_score_metrics_dict_acc[lang] |
|
for lang in agg_score_metrics_dict_prob.keys() |
|
} |
|
|
|
|
|
agg_score_metrics = { |
|
"prob": agg_score_metrics_dict_prob, |
|
"prob_raw": agg_score_metrics_dict_prob_raw, |
|
"acc": agg_score_metrics_dict_acc, |
|
"both": agg_score_metrics_dict_both |
|
} |
|
|
|
|
|
|
|
custom_task_aggregate_groups = { |
|
'custom|agieval_NEW_LINE': [ |
|
'gaokao-biology', 'gaokao-chemistry', 'gaokao-chinese', 'gaokao-geography', |
|
'gaokao-history', 'gaokao-physics', 'jec-qa-ca', |
|
'jec-qa-kd', 'logiqa-zh' |
|
] |
|
} |
|
|
|
def is_agg_score_col(col: str, agg_score_type: AGG_SCORE_METRICS_TYPE, lang: str): |
|
metric_name = col |
|
if agg_score_type == "agg_score_metrics_prob_raw": |
|
return metric_name in agg_score_metrics_dict_prob_raw.get(lang, []) |
|
elif agg_score_type == "agg_score_metrics_acc": |
|
return metric_name in agg_score_metrics_dict_acc.get(lang, []) |
|
|
|
return agg_score_metrics_dict_prob.get(lang, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|