Commit c5ebdd0f authored by ManuelFay's avatar ManuelFay
Browse files

add belebele

parent 0aa37743
...@@ -59,6 +59,7 @@ Boxes should be checked iff tasks are implemented in the refactor and tested for ...@@ -59,6 +59,7 @@ Boxes should be checked iff tasks are implemented in the refactor and tested for
- [x] MGSM - [x] MGSM
- [ ] SCROLLS - [ ] SCROLLS
- [x] Babi - [x] Babi
- [x] Belebele
# Novel Tasks # Novel Tasks
Tasks added in the revamped harness that were not previously available. Again, a strikethrough denotes checking performed *against the original task's implementation or published results introducing the task*. Tasks added in the revamped harness that were not previously available. Again, a strikethrough denotes checking performed *against the original task's implementation or published results introducing the task*.
......
# Belebele
### Paper
The Belebele Benchmark for Massively Multilingual NLU Evaluation
https://arxiv.org/abs/2308.16884
Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants. This dataset enables the evaluation of mono- and multi-lingual models in high-, medium-, and low-resource languages. Each question has four multiple-choice answers and is linked to a short passage from the FLORES-200 dataset. The human annotation procedure was carefully curated to create questions that discriminate between different levels of generalizable language comprehension and is reinforced by extensive quality checks. While all questions directly relate to the passage, the English dataset on its own proves difficult enough to challenge state-of-the-art language models. Being fully parallel, this dataset enables direct comparison of model performance across all languages. Belebele opens up new avenues for evaluating and analyzing the multilingual abilities of language models and NLP systems.
Homepage: https://github.com/facebookresearch/belebele
### Citation
```bibtex
@misc{bandarkar2023belebele,
title={The Belebele Benchmark: a Parallel Reading Comprehension Dataset in 122 Language Variants},
author={Lucas Bandarkar and Davis Liang and Benjamin Muller and Mikel Artetxe and Satya Narayan Shukla and Donald Husa and Naman Goyal and Abhinandan Krishnan and Luke Zettlemoyer and Madian Khabsa},
year={2023},
eprint={2308.16884},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
```
### Groups and Tasks
#### Groups
- `belebele`: All 122 languages of the Belebele dataset, evaluated following the methodology in MMLU's original implementation.
#### Tasks
The following tasks evaluate languages in the Belebele dataset using loglikelihood-based multiple-choice scoring:
- `cmmlu_{language}`
### Checklist
* [x] Is the task an existing benchmark in the literature?
* [x] Have you referenced the original paper that introduced the task?
* [x] If yes, does the original paper provide a reference implementation?
* [ ] Yes, original implementation contributed by author of the benchmark
If other tasks on this dataset are already supported:
* [x] Is the "Main" variant of this task clearly denoted?
* [x] Have you provided a short sentence in a README on what each new variant adds / evaluates?
* [ ] Have you noted which, if any, published evaluation setups are matched by this variant?
group: belebele
dataset_path: facebook/belebele
test_split: test
fewshot_split: test
fewshot_config:
sampler: first_n
output_type: multiple_choice
should_decontaminate: true
doc_to_decontamination_query: "{{question}}"
doc_to_text: "{{question.strip()}}\nA. {{mc_answer1}}\nB. {{mc_answer2}}\nC. {{mc_answer3}}\nD. {{mc_answer4}}\nAnswer:"
doc_to_choice: ["A", "B", "C", "D"]
doc_to_target: "{{['1', '2', '3', '4'].index(correct_answer_num)}}"
metric_list:
- metric: acc
aggregation: mean
higher_is_better: true
- metric: acc_norm
aggregation: mean
higher_is_better: true
"""
Take in a YAML, and output all other splits with this YAML
"""
import os
import yaml
import argparse
import requests
from tqdm import tqdm
from lm_eval.logger import eval_logger
API_URL = "https://datasets-server.huggingface.co/splits?dataset=facebook/belebele"
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--base_yaml_path", required=True)
parser.add_argument("--save_prefix_path", default="belebele")
parser.add_argument("--cot_prompt_path", default=None)
parser.add_argument("--task_prefix", default="")
return parser.parse_args()
if __name__ == "__main__":
args = parse_args()
# get filename of base_yaml so we can `"include": ` it in our other YAMLs.
base_yaml_name = os.path.split(args.base_yaml_path)[-1]
with open(args.base_yaml_path) as f:
base_yaml = yaml.full_load(f)
if args.cot_prompt_path is not None:
import json
with open(args.cot_prompt_path) as f:
cot_file = json.load(f)
def query():
response = requests.get(API_URL)
return response.json()["splits"]
languages = [split["config"] for split in query()]
for lang in tqdm(languages):
description = f"A split of Belebele for the {lang} language.\n\n"
yaml_dict = {
"include": base_yaml_name,
"task": f"belebele_{args.task_prefix}_{subject_eng}"
if args.task_prefix != ""
else f"belebele_{lang}",
"dataset_name": lang,
"description": description,
}
file_save_path = args.save_prefix_path + f"_{lang}.yaml"
eval_logger.info(f"Saving yaml for subset {lang} to {file_save_path}")
with open(file_save_path, "w") as yaml_file:
yaml.dump(
yaml_dict,
yaml_file,
width=float("inf"),
allow_unicode=True,
default_style='"',
)
"dataset_name": "acm_Arab"
"description": "A split of Belebele for the acm_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_acm_Arab"
"dataset_name": "afr_Latn"
"description": "A split of Belebele for the afr_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_afr_Latn"
"dataset_name": "als_Latn"
"description": "A split of Belebele for the als_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_als_Latn"
"dataset_name": "amh_Ethi"
"description": "A split of Belebele for the amh_Ethi language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_amh_Ethi"
"dataset_name": "apc_Arab"
"description": "A split of Belebele for the apc_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_apc_Arab"
"dataset_name": "arb_Arab"
"description": "A split of Belebele for the arb_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_arb_Arab"
"dataset_name": "arb_Latn"
"description": "A split of Belebele for the arb_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_arb_Latn"
"dataset_name": "ars_Arab"
"description": "A split of Belebele for the ars_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_ars_Arab"
"dataset_name": "ary_Arab"
"description": "A split of Belebele for the ary_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_ary_Arab"
"dataset_name": "arz_Arab"
"description": "A split of Belebele for the arz_Arab language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_arz_Arab"
"dataset_name": "asm_Beng"
"description": "A split of Belebele for the asm_Beng language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_asm_Beng"
"dataset_name": "azj_Latn"
"description": "A split of Belebele for the azj_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_azj_Latn"
"dataset_name": "bam_Latn"
"description": "A split of Belebele for the bam_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_bam_Latn"
"dataset_name": "ben_Beng"
"description": "A split of Belebele for the ben_Beng language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_ben_Beng"
"dataset_name": "ben_Latn"
"description": "A split of Belebele for the ben_Latn language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_ben_Latn"
"dataset_name": "bod_Tibt"
"description": "A split of Belebele for the bod_Tibt language.\n\n"
"include": "_default_template_yaml"
"task": "belebele_bod_Tibt"
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