Unverified Commit 18297993 authored by Jess's avatar Jess Committed by GitHub
Browse files

AfroBench: How Good are Large Language Models on African Languages? (#2825)



* add afrixnli to task

* add chat completion

* remove chat completion -untested

* afrimmlu added

* afrimmlu folder update

* afrimmlu folder update

* updated prompt

* remove print

* add afrimgsm -direct

* add squad metric

* fix bash script

* remove direct util, update common yaml

* remove print

* add few show. metric fixes

* fix direct path, add bash script for gpt models

* added transate test

* update afrixnli tasks

* update afrixnli tasks

* update metrics for afrixnli

* prompt translations fix

* prompt translations fix

* filter and metric fix -mgsm

* remove squad metric

* remove squad metric

* add f1 score to mgsm

* add f1 score to mgsm

* update native-direct with lin

* change f1 function

* add lin to utils

* add utils

* remove test limit

* remove test configs

* add swahili to mmlu

* change eng to ewe in ewe yaml mmlu

* add squad metric to mgsm, remove whitespace filter

* added translate test

* added afrixnli_translate

* fix exact match valueError

* fix exact match valueError

* restructure mmlu folder

* spacing

* remove afrimmlu_translate folder

* add utility

* format task name, clean ups

* modefied mgsm

* update on afrimgsm

* update on afrimgsm

* removed utils

* other mgsm varieties

* other mgsm varieties

* adding trasnslate direct

* Update translate_direct_yaml

* add manual xnli prompt, add multichoice for openai models, and adapt multichoice metric for openai model

* edit for open models

* Update translate_direct_yaml

* add verbalizer for xnli

* change xnli from multiple choice to generate

* add manual accuracy scores

* revert xnli to multiple choice

* change afrimgsm utils

* revert xnli to multiple_choice

* cleanups and readmes

* remove openai fixes and unused regex

* pr review changes

* revert metrics.py, task.py and extraction.py to main version

* add afrisenti

* utilities

* pulled from main

* add afrixnli

* add afrimmlu

* update afrixnli prompts

* mising senti language

* fix afrisenti prompt 2

* fix afrisenti prompts

* fix afrisenti prompts

* configure task grouping

* add multiple prompts to afrixnli for irokobench

* add multiple prompts to afrimmlu for irokobench

* Update afrixnli_yaml

* fixes and moves

* fixes and moves

* afrimmlu multiple prompts configs

* remove validation set from afrimmlu

* remove eng from afrimmlu translate test

* correct dataset path

* multiple prompts for mgsm

* file restructure

* afribench grouping

* repo restructuring

* repo restructuring

* update exact match to hugging face exact match and add new mgsm language

* remove decontamination

* update generation kwargs

* update generation kwargs for all mgsm prompts

* remove lang

* update generation kwargs for afrimgsm translatetest

* add afrimgsm cot for direct and translate

* remove eng from translate-cot

* add masakhaPOS tasks

* remove changes from task script

* add masakhanews tasks

* add uhura arc easy

* add afriqa and belebele files

* add tags for easier run. add naija rc

* add new metrics and transformation scripts

* fix afriqa swa fewshot split

* add naijarc

* add afrobench lite tasks

* update afrobench

* update afrobench

* remove unverified files to avoid bugs

* remove files not needed

* add afrobench tasks

* add afrobench tasks

* change to version 1

* change to version 1

* update afrobench

* update afrobench

* restore metric to original script

* update readme instructions

* add individual dataset readmes

* add link to collections

* correct run script

* align with main

* align with main

* align with main

* align with main

* align with main

* align with main

* align with main

* align with main

* failed run fixes

* failed run fixes

* add afrimgsm cot

* Apply precommit fixes

* update mafand dataset name

* pull request fixes

* remove afrihate due to availability

---------
Co-authored-by: default avatarIsrael Abebe Azime <azime@cg.uni-saarland.de>
Co-authored-by: default avatarIsrael Abebe Azime <se.israel.abebe@gmail.com>
Co-authored-by: default avatarDavid Adelani <davlanade@gmail.com>
Co-authored-by: default avatartheyorubayesian <akin.o.oladipo@gmail.com>
parent cf51e699
# Generated by utils.py
dataset_name: sot
doc_to_text: "For mathematical questions provided in Sesotho language. Supply the\
\ accurate step by step answer to the provided question. \n\nQuestion: {{question}}\
\ \nStep by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_sot_prompt_5
# Generated by utils.py
dataset_name: swa
doc_to_text: "For mathematical questions provided in Swahili language. Supply the\
\ accurate step by step answer to the provided question. \n\nQuestion: {{question}}\
\ \nStep by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_swa_prompt_5
# Generated by utils.py
dataset_name: twi
doc_to_text: "For mathematical questions provided in Twi language. Supply the accurate\
\ step by step answer to the provided question. \n\nQuestion: {{question}} \nStep\
\ by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_twi_prompt_5
# Generated by utils.py
dataset_name: vai
doc_to_text: "For mathematical questions provided in Vai language. Supply the accurate\
\ step by step answer to the provided question. \n\nQuestion: {{question}} \nStep\
\ by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_vai_prompt_5
# Generated by utils.py
dataset_name: wol
doc_to_text: "For mathematical questions provided in Wolof language. Supply the accurate\
\ step by step answer to the provided question. \n\nQuestion: {{question}} \nStep\
\ by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_wol_prompt_5
# Generated by utils.py
dataset_name: xho
doc_to_text: "For mathematical questions provided in isiXhosa language. Supply the\
\ accurate step by step answer to the provided question. \n\nQuestion: {{question}}\
\ \nStep by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_xho_prompt_5
tag: afrimgsm_tt_cot_tasks
dataset_path: masakhane/afrimgsm-translate-test
dataset_name: null # Overridden by language-specific config.
output_type: generate_until
test_split: test
doc_to_target: '{% if answer is not none %}{{answer[21:]}}{% else %}{{answer_number|string}}{% endif %}'
generation_kwargs:
do_sample: false
until:
- 'Question:'
- </s>
- <|im_end|>
metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
filter_list:
- name: "strict-match"
filter:
- function: "regex"
regex_pattern: "The answer is (\\-?[0-9\\.\\,]+)"
- function: "take_first"
- filter:
- function: regex
group_select: -1
regex_pattern: (-?[$0-9.,]{2,})|(-?[0-9]+)
- function: take_first
name: flexible-extract
metadata:
version: 2.0
# Generated by utils.py
dataset_name: yor
doc_to_text: "For mathematical questions provided in Yoruba language. Supply the accurate\
\ step by step answer to the provided question. \n\nQuestion: {{question}} \nStep\
\ by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_yor_prompt_5
# Generated by utils.py
dataset_name: zul
doc_to_text: "For mathematical questions provided in Zulu language. Supply the accurate\
\ step by step answer to the provided question. \n\nQuestion: {{question}} \nStep\
\ by step answer: "
include: afrimgsm_cot_translate_yaml
task: afrimgsm_cot_translate_zul_prompt_5
group: afrimmlu-irokobench
task:
- afrimmlu_tasks_prompt_1
- afrimmlu_tasks_prompt_2
- afrimmlu_tasks_prompt_3
- afrimmlu_tasks_prompt_4
- afrimmlu_tasks_prompt_5
aggregate_metric_list:
- metric: acc
aggregation: mean
weight_by_size: true
metadata:
version: 2
tag:
- afrimmlu
- afrimmlu_direct
task: null
dataset_path: masakhane/afrimmlu
dataset_name: null
output_type: multiple_choice
validation_split: validation
test_split: test
fewshot_split: validation
doc_to_text: !function utils.doc_to_text
doc_to_target: "{{['A', 'B', 'C', 'D'].index(answer)}}"
doc_to_choice: !function utils.doc_to_choice
should_decontaminate: true
doc_to_decontamination_query: "Question: {{question}}\nAnswer:"
metric_list:
- metric: f1
aggregation: !function utils.weighted_f1_score
# aggregation: mean
average: weighted
hf_evaluate: true
higher_is_better: True
ignore_case: true
ignore_punctuation: true
regexes_to_ignore:
- ","
- "\\$"
- metric: acc
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
regexes_to_ignore:
- ","
- "\\$"
metadata:
version: 1.0
dataset_name: amh
include: afrimmlu_common_yaml
task: afrimmlu_direct_amh
dataset_name: eng
include: afrimmlu_common_yaml
task: afrimmlu_direct_eng
dataset_name: ewe
include: afrimmlu_common_yaml
task: afrimmlu_direct_ewe
dataset_name: fra
include: afrimmlu_common_yaml
task: afrimmlu_direct_fra
dataset_name: hau
include: afrimmlu_common_yaml
task: afrimmlu_direct_hau
dataset_name: ibo
include: afrimmlu_common_yaml
task: afrimmlu_direct_ibo
dataset_name: kin
include: afrimmlu_common_yaml
task: afrimmlu_direct_kin
dataset_name: lin
include: afrimmlu_common_yaml
task: afrimmlu_direct_lin
dataset_name: lug
include: afrimmlu_common_yaml
task: afrimmlu_direct_lug
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