"git@developer.sourcefind.cn:sugon_wxj/megatron-lm.git" did not exist on "1c4c360fdec75da2f9fe27e10046bcbe1e1e7e5b"
Unverified Commit 383bbd54 authored by Jess's avatar Jess Committed by GitHub
Browse files

Irokobench: Benchmark Dataset for African languages (#2042)



* 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

---------
Co-authored-by: default avatarIsrael Abebe Azime <azime@cg.uni-saarland.de>
Co-authored-by: default avatarIsrael Abebe Azime <se.israel.abebe@gmail.com>
parent d5f39bf8
# Generated by utils.py
dataset_name: swa
doc_to_choice: '{{[premise+", Sahihi? Ndiyo, "+hypothesis,premise+", Sahihi? Pia,
"+hypothesis,premise+", Sahihi? Hapana, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_swa
# Generated by utils.py
dataset_name: twi
doc_to_choice: '{{[premise+", Nifa? Aane, "+hypothesis,premise+", Nifa? Anaasɛ, "+hypothesis,premise+",
Nifa? Daabi, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_twi
# Generated by utils.py
dataset_name: wol
doc_to_choice: '{{[premise+", Dëgg? Waaw, "+hypothesis,premise+", Dëgg? Itam, "+hypothesis,premise+",
Dëgg? Déet, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_wol
# Generated by utils.py
dataset_name: xho
doc_to_choice: '{{[premise+", Ichanekile? Ewe, "+hypothesis,premise+", Ichanekile?
Kananjalo, "+hypothesis,premise+", Ichanekile? Hayi, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_xho
group:
- xnli
- afrixnli
- afrixnli_native_direct
dataset_path: masakhane/afrixnli
dataset_name: null
output_type: multiple_choice
validation_split: validation
test_split: test
fewshot_split: validation
doc_to_target: label
doc_to_text: ""
metric_list:
- metric: f1
aggregation: !function utils.weighted_f1_score
average: weighted
higher_is_better: True
ignore_case: true
ignore_punctuation: true
- metric: acc
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
metadata:
version: 1.0
# Generated by utils.py
dataset_name: yor
doc_to_choice: '{{[premise+", Òótọ́? Bẹ́ẹ̀ni, "+hypothesis,premise+", Òótọ́? Àti pé,
"+hypothesis,premise+", Òótọ́? Rárá, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_yor
# Generated by utils.py
dataset_name: zul
doc_to_choice: '{{[premise+", Kulungile? Yebo, "+hypothesis,premise+", Kulungile?
Futhi, "+hypothesis,premise+", Kulungile? Cha, "+hypothesis]}}'
include: afrixnli_native_direct_yaml
task: afrixnli_native_direct_zul
from sklearn.metrics import f1_score
def weighted_f1_score(items):
unzipped_list = list(zip(*items))
golds = unzipped_list[0]
preds = unzipped_list[1]
fscore = f1_score(golds, preds, average="weighted")
return fscore
# Generated by utils.py
dataset_name: amh
include: afrixnli_translate_yaml
task: afrixnli_translate_amh
# Generated by utils.py
dataset_name: ewe
include: afrixnli_translate_yaml
task: afrixnli_translate_ewe
# Generated by utils.py
dataset_name: fra
include: afrixnli_translate_yaml
task: afrixnli_translate_fra
# Generated by utils.py
dataset_name: hau
include: afrixnli_translate_yaml
task: afrixnli_translate_hau
# Generated by utils.py
dataset_name: ibo
include: afrixnli_translate_yaml
task: afrixnli_translate_ibo
# Generated by utils.py
dataset_name: kin
include: afrixnli_translate_yaml
task: afrixnli_translate_kin
# Generated by utils.py
dataset_name: lin
include: afrixnli_translate_yaml
task: afrixnli_translate_lin
# Generated by utils.py
dataset_name: lug
include: afrixnli_translate_yaml
task: afrixnli_translate_lug
# Generated by utils.py
dataset_name: orm
include: afrixnli_translate_yaml
task: afrixnli_translate_orm
# Generated by utils.py
dataset_name: sna
include: afrixnli_translate_yaml
task: afrixnli_translate_sna
# Generated by utils.py
dataset_name: sot
include: afrixnli_translate_yaml
task: afrixnli_translate_sot
# Generated by utils.py
dataset_name: swa
include: afrixnli_translate_yaml
task: afrixnli_translate_swa
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