Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- lm-evaluation-harness/lm_eval/tasks/afrixnli/translate/prompt_3/afrixnli_translate_zul.yaml +8 -0
- lm-evaluation-harness/lm_eval/tasks/afrixnli/translate/prompt_5/afrixnli_translate_yor.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_1/afridiacritics_ibo.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_1/afridiacritics_wol.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_2/afridiacritics_bbj.yaml +7 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_2/afridiacritics_fon.yaml +7 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_ibo.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_wol.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_yaml +25 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_yor.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_bbj.yaml +7 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_fon.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_ibo.yaml +6 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_wol.yaml +7 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_yaml +25 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_ibo.yaml +8 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_wol.yaml +8 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_yor.yaml +8 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/README.md +24 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/afriqa.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa +42 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_bem.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_hau.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_ibo.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_kin.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_twi.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_yor.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_zul.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/utils.py +53 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa +42 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_bem.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_fon.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_hau.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_ibo.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_kin.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_swa.yaml +16 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_twi.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_yor.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_zul.yaml +13 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/utils.py +53 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa +42 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_bem.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_fon.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_hau.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_ibo.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_kin.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_swa.yaml +15 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_twi.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_yor.yaml +12 -0
- lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_zul.yaml +12 -0
lm-evaluation-harness/lm_eval/tasks/afrixnli/translate/prompt_3/afrixnli_translate_zul.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: zul
|
| 3 |
+
doc_to_text: "Given the following premise and hypothesis in Zulu, identify if the\
|
| 4 |
+
\ premise entails, contradicts, or is neutral towards the hypothesis. Please respond\
|
| 5 |
+
\ with exact 'entailment', 'contradiction', or 'neutral'. \n\nPremise: {{premise}}\
|
| 6 |
+
\ \nHypothesis: {{hypothesis}}"
|
| 7 |
+
include: afrixnli_translate_yaml
|
| 8 |
+
task: afrixnli_translate_zul_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrixnli/translate/prompt_5/afrixnli_translate_yor.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: "Based on the given statement, is the following claim 'true', 'false',\
|
| 4 |
+
\ or 'inconclusive'. \nStatement: {{premise}} \nClaim: {{hypothesis}}"
|
| 5 |
+
include: afrixnli_translate_yaml
|
| 6 |
+
task: afrixnli_translate_yor_prompt_5
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_1/afridiacritics_ibo.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'Please restore the missing diacritics in the following sentence: {{text}}.
|
| 4 |
+
Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_ibo_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_1/afridiacritics_wol.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: wol
|
| 3 |
+
doc_to_text: 'Please restore the missing diacritics in the following sentence: {{text}}.
|
| 4 |
+
Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_wol_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_2/afridiacritics_bbj.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: bbj
|
| 3 |
+
doc_to_text: "Given a sentence without diacritics, add the appropriate diacritics\
|
| 4 |
+
\ to make it grammatically and semantically correct. \nSentence: {{text}}. Return\
|
| 5 |
+
\ output sentence only"
|
| 6 |
+
include: afridiacritics_yaml
|
| 7 |
+
task: afridiacritics_bbj_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_2/afridiacritics_fon.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: fon
|
| 3 |
+
doc_to_text: "Given a sentence without diacritics, add the appropriate diacritics\
|
| 4 |
+
\ to make it grammatically and semantically correct. \nSentence: {{text}}. Return\
|
| 5 |
+
\ output sentence only"
|
| 6 |
+
include: afridiacritics_yaml
|
| 7 |
+
task: afridiacritics_fon_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_ibo.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'This text is in Igbo. Restore all diacritical marks to their proper
|
| 4 |
+
places in the following sentence: {{text}}. Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_ibo_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_wol.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: wol
|
| 3 |
+
doc_to_text: 'This text is in Wolof. Restore all diacritical marks to their proper
|
| 4 |
+
places in the following sentence: {{text}}. Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_wol_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tag:
|
| 2 |
+
- adr_tasks
|
| 3 |
+
- adr_prompt_3
|
| 4 |
+
dataset_path: masakhane/diacritics-restoration
|
| 5 |
+
dataset_kwargs: {trust_remote_code: True}
|
| 6 |
+
doc_to_target: target
|
| 7 |
+
output_type: generate_until
|
| 8 |
+
fewshot_split: dev
|
| 9 |
+
test_split: test
|
| 10 |
+
training_split: train
|
| 11 |
+
metric_list:
|
| 12 |
+
- metric: bleu
|
| 13 |
+
aggregation: bleu
|
| 14 |
+
higher_is_better: true
|
| 15 |
+
- metric: chrf
|
| 16 |
+
aggregation: chrf
|
| 17 |
+
higher_is_better: true
|
| 18 |
+
generation_kwargs:
|
| 19 |
+
do_sample: false
|
| 20 |
+
until:
|
| 21 |
+
- '<eos>'
|
| 22 |
+
- </s>
|
| 23 |
+
- <|im_end|>
|
| 24 |
+
metadata:
|
| 25 |
+
version: 1.0
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_3/afridiacritics_yor.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: 'This text is in Yoruba. Restore all diacritical marks to their proper
|
| 4 |
+
places in the following sentence: {{text}}. Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_yor_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_bbj.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: bbj
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Gbomala. Add
|
| 4 |
+
the appropriate diacritics to this Gbomala sentence: {{text}}. Return output sentence
|
| 5 |
+
only'
|
| 6 |
+
include: afridiacritics_yaml
|
| 7 |
+
task: afridiacritics_bbj_prompt_4
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_fon.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: fon
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Fon. Add the
|
| 4 |
+
appropriate diacritics to this Fon sentence: {{text}}. Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_fon_prompt_4
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_ibo.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Igbo. Add the
|
| 4 |
+
appropriate diacritics to this Igbo sentence: {{text}}. Return output sentence only'
|
| 5 |
+
include: afridiacritics_yaml
|
| 6 |
+
task: afridiacritics_ibo_prompt_4
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_wol.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: wol
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Wolof. Add
|
| 4 |
+
the appropriate diacritics to this Wolof sentence: {{text}}. Return output sentence
|
| 5 |
+
only'
|
| 6 |
+
include: afridiacritics_yaml
|
| 7 |
+
task: afridiacritics_wol_prompt_4
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_4/afridiacritics_yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tag:
|
| 2 |
+
- adr_tasks
|
| 3 |
+
- adr_prompt_4
|
| 4 |
+
dataset_path: masakhane/diacritics-restoration
|
| 5 |
+
dataset_kwargs: {trust_remote_code: True}
|
| 6 |
+
doc_to_target: target
|
| 7 |
+
output_type: generate_until
|
| 8 |
+
fewshot_split: dev
|
| 9 |
+
test_split: test
|
| 10 |
+
training_split: train
|
| 11 |
+
metric_list:
|
| 12 |
+
- metric: bleu
|
| 13 |
+
aggregation: bleu
|
| 14 |
+
higher_is_better: true
|
| 15 |
+
- metric: chrf
|
| 16 |
+
aggregation: chrf
|
| 17 |
+
higher_is_better: true
|
| 18 |
+
generation_kwargs:
|
| 19 |
+
do_sample: false
|
| 20 |
+
until:
|
| 21 |
+
- '<eos>'
|
| 22 |
+
- </s>
|
| 23 |
+
- <|im_end|>
|
| 24 |
+
metadata:
|
| 25 |
+
version: 1.0
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_ibo.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Igbo. Diacritics
|
| 4 |
+
are essential for proper pronunciation and meaning in Igbo. You are tasked with
|
| 5 |
+
converting Igbo sentences without diacritics into their correctly accented forms.
|
| 6 |
+
Here''s the input: {{text}}. Return output sentence only'
|
| 7 |
+
include: afridiacritics_yaml
|
| 8 |
+
task: afridiacritics_ibo_prompt_5
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_wol.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: wol
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Wolof. Diacritics
|
| 4 |
+
are essential for proper pronunciation and meaning in Wolof. You are tasked with
|
| 5 |
+
converting Wolof sentences without diacritics into their correctly accented forms.
|
| 6 |
+
Here''s the input: {{text}}. Return output sentence only'
|
| 7 |
+
include: afridiacritics_yaml
|
| 8 |
+
task: afridiacritics_wol_prompt_5
|
lm-evaluation-harness/lm_eval/tasks/afrobench/adr/prompt_5/afridiacritics_yor.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: 'You are a linguist specializing in diacritical marks for Yoruba. Diacritics
|
| 4 |
+
are essential for proper pronunciation and meaning in Yoruba. You are tasked with
|
| 5 |
+
converting Yoruba sentences without diacritics into their correctly accented forms.
|
| 6 |
+
Here''s the input: {{text}}. Return output sentence only'
|
| 7 |
+
include: afridiacritics_yaml
|
| 8 |
+
task: afridiacritics_yor_prompt_5
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#
|
| 2 |
+
|
| 3 |
+
## Paper
|
| 4 |
+
Title: `AfriQA: Cross-lingual Open-Retrieval Question Answering for African Languages`
|
| 5 |
+
|
| 6 |
+
Paper Link: https://arxiv.org/abs/2305.06897
|
| 7 |
+
|
| 8 |
+
## Abstract
|
| 9 |
+
>AfriQA is the first cross-lingual question answering (QA) dataset with a focus on African languages. The dataset includes over 12,000 XOR QA examples across 10 African languages, making it an invaluable resource for developing more equitable QA technology. African languages have historically been underserved in the digital landscape, with far less in-language content available online. This makes it difficult for QA systems to provide accurate information to users in their native language. However, cross-lingual open-retrieval question answering (XOR QA) systems can help fill this gap by retrieving answer content from other languages. AfriQA focuses specifically on African languages where cross-lingual answer content is the only high-coverage source of information. Previous datasets have primarily focused on languages where cross-lingual QA augments coverage from the target language, but AfriQA highlights the importance of African languages as a realistic use case for XOR QA.
|
| 10 |
+
|
| 11 |
+
HomePage: https://github.com/masakhane-io/afriqa
|
| 12 |
+
|
| 13 |
+
### Citation
|
| 14 |
+
|
| 15 |
+
```
|
| 16 |
+
@misc{ogundepo2023afriqa,
|
| 17 |
+
title={AfriQA: Cross-lingual Open-Retrieval Question Answering for African Languages},
|
| 18 |
+
author={Odunayo Ogundepo and Tajuddeen R. Gwadabe and Clara E. Rivera and Jonathan H. Clark and Sebastian Ruder and David Ifeoluwa Adelani and Bonaventure F. P. Dossou and Abdou Aziz DIOP and Claytone Sikasote and Gilles Hacheme and Happy Buzaaba and Ignatius Ezeani and Rooweither Mabuya and Salomey Osei and Chris Emezue and Albert Njoroge Kahira and Shamsuddeen H. Muhammad and Akintunde Oladipo and Abraham Toluwase Owodunni and Atnafu Lambebo Tonja and Iyanuoluwa Shode and Akari Asai and Tunde Oluwaseyi Ajayi and Clemencia Siro and Steven Arthur and Mofetoluwa Adeyemi and Orevaoghene Ahia and Aremu Anuoluwapo and Oyinkansola Awosan and Chiamaka Chukwuneke and Bernard Opoku and Awokoya Ayodele and Verrah Otiende and Christine Mwase and Boyd Sinkala and Andre Niyongabo Rubungo and Daniel A. Ajisafe and Emeka Felix Onwuegbuzia and Habib Mbow and Emile Niyomutabazi and Eunice Mukonde and Falalu Ibrahim Lawan and Ibrahim Said Ahmad and Jesujoba O. Alabi and Martin Namukombo and Mbonu Chinedu and Mofya Phiri and Neo Putini and Ndumiso Mngoma and Priscilla A. Amuok and Ruqayya Nasir Iro and Sonia Adhiambo},
|
| 19 |
+
year={2023},
|
| 20 |
+
eprint={2305.06897},
|
| 21 |
+
archivePrefix={arXiv},
|
| 22 |
+
primaryClass={cs.CL}
|
| 23 |
+
}
|
| 24 |
+
```
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/afriqa.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
group: afriqa
|
| 2 |
+
task:
|
| 3 |
+
- afriqa_prompt_1
|
| 4 |
+
- afriqa_prompt_2
|
| 5 |
+
- afriqa_prompt_3
|
| 6 |
+
- afriqa_prompt_4
|
| 7 |
+
- afriqa_prompt_5
|
| 8 |
+
aggregate_metric_list:
|
| 9 |
+
- metric: acc
|
| 10 |
+
aggregation: mean
|
| 11 |
+
weight_by_size: true
|
| 12 |
+
metadata:
|
| 13 |
+
version: 1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tag:
|
| 2 |
+
- afrobench_xqa_tasks
|
| 3 |
+
- afriqa_prompt_1
|
| 4 |
+
dataset_kwargs: {trust_remote_code: True}
|
| 5 |
+
dataset_path: masakhane/afriqa-gold-passages
|
| 6 |
+
dataset_name: null
|
| 7 |
+
output_type: generate_until
|
| 8 |
+
test_split: test
|
| 9 |
+
fewshot_split: train
|
| 10 |
+
doc_to_target: answer_pivot
|
| 11 |
+
should_decontaminate: true
|
| 12 |
+
doc_to_decontamination_query: question_lang
|
| 13 |
+
generation_kwargs:
|
| 14 |
+
until:
|
| 15 |
+
- "\n"
|
| 16 |
+
do_sample: false
|
| 17 |
+
temperature: 0.0
|
| 18 |
+
filter_list:
|
| 19 |
+
- name: remove_whitespace
|
| 20 |
+
filter:
|
| 21 |
+
- function: remove_whitespace
|
| 22 |
+
- function: take_first
|
| 23 |
+
target_delimiter: " "
|
| 24 |
+
metric_list:
|
| 25 |
+
- metric: exact_match
|
| 26 |
+
aggregation: mean
|
| 27 |
+
higher_is_better: true
|
| 28 |
+
ignore_case: true
|
| 29 |
+
ignore_punctuation: true
|
| 30 |
+
- "."
|
| 31 |
+
- ","
|
| 32 |
+
- "\\$"
|
| 33 |
+
- metric: f1
|
| 34 |
+
aggregation: !function utils.f1
|
| 35 |
+
higher_is_better: true
|
| 36 |
+
ignore_case: true
|
| 37 |
+
ignore_punctuation: true
|
| 38 |
+
- "."
|
| 39 |
+
- ","
|
| 40 |
+
- "\\$"
|
| 41 |
+
metadata:
|
| 42 |
+
version: 1.0
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_bem.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: bem
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_bem_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_hau.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: hau
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_hau_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_ibo.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_ibo_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_kin.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: kin
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_kin_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_twi.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: twi
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_twi_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_yor.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_yor_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/afriqa_zul.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: zul
|
| 3 |
+
doc_to_text: 'Your task is to answer a qestion given a context.Make sure you respond
|
| 4 |
+
with the shortest span containing the answer in the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_zul_prompt_1
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_1/utils.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
import string
|
| 3 |
+
from collections import Counter
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def normalize_answer(s):
|
| 7 |
+
"""
|
| 8 |
+
Taken from the official evaluation script for v1.1 of the SQuAD dataset.
|
| 9 |
+
Lower text and remove punctuation, articles and extra whitespace.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
def remove_articles(text):
|
| 13 |
+
return re.sub(r"\b(a|an|the)\b", " ", text)
|
| 14 |
+
|
| 15 |
+
def white_space_fix(text):
|
| 16 |
+
return " ".join(text.split())
|
| 17 |
+
|
| 18 |
+
def remove_punc(text):
|
| 19 |
+
exclude = set(string.punctuation)
|
| 20 |
+
return "".join(ch for ch in text if ch not in exclude)
|
| 21 |
+
|
| 22 |
+
def lower(text):
|
| 23 |
+
return text.lower()
|
| 24 |
+
|
| 25 |
+
return white_space_fix(remove_articles(remove_punc(lower(s))))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def f1(items):
|
| 29 |
+
"""
|
| 30 |
+
Taken from the official evaluation script for v1.1 of the SQuAD dataset.
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
unzipped_list = list(zip(*items))
|
| 34 |
+
golds = unzipped_list[0]
|
| 35 |
+
preds = unzipped_list[1]
|
| 36 |
+
|
| 37 |
+
f1_list = []
|
| 38 |
+
|
| 39 |
+
for i in range(len(golds)):
|
| 40 |
+
prediction_tokens = normalize_answer(preds[i]).split()
|
| 41 |
+
references_tokens = normalize_answer(golds[i]).split()
|
| 42 |
+
common = Counter(prediction_tokens) & Counter(references_tokens)
|
| 43 |
+
num_same = sum(common.values())
|
| 44 |
+
if num_same == 0:
|
| 45 |
+
f1_score = 0
|
| 46 |
+
else:
|
| 47 |
+
precision = 1.0 * num_same / len(prediction_tokens)
|
| 48 |
+
recall = 1.0 * num_same / len(references_tokens)
|
| 49 |
+
f1_score = (2 * precision * recall) / (precision + recall)
|
| 50 |
+
|
| 51 |
+
f1_list.append(f1_score)
|
| 52 |
+
|
| 53 |
+
return sum(f1_list) / len(f1_list)
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tag:
|
| 2 |
+
- afrobench_xqa_tasks
|
| 3 |
+
- afriqa_prompt_2
|
| 4 |
+
dataset_kwargs: {trust_remote_code: True}
|
| 5 |
+
dataset_path: masakhane/afriqa-gold-passages
|
| 6 |
+
dataset_name: null
|
| 7 |
+
output_type: generate_until
|
| 8 |
+
test_split: test
|
| 9 |
+
fewshot_split: train
|
| 10 |
+
doc_to_target: answer_pivot
|
| 11 |
+
should_decontaminate: true
|
| 12 |
+
doc_to_decontamination_query: question_lang
|
| 13 |
+
generation_kwargs:
|
| 14 |
+
until:
|
| 15 |
+
- "\n"
|
| 16 |
+
do_sample: false
|
| 17 |
+
temperature: 0.0
|
| 18 |
+
filter_list:
|
| 19 |
+
- name: remove_whitespace
|
| 20 |
+
filter:
|
| 21 |
+
- function: remove_whitespace
|
| 22 |
+
- function: take_first
|
| 23 |
+
target_delimiter: " "
|
| 24 |
+
metric_list:
|
| 25 |
+
- metric: exact_match
|
| 26 |
+
aggregation: mean
|
| 27 |
+
higher_is_better: true
|
| 28 |
+
ignore_case: true
|
| 29 |
+
ignore_punctuation: true
|
| 30 |
+
- "."
|
| 31 |
+
- ","
|
| 32 |
+
- "\\$"
|
| 33 |
+
- metric: f1
|
| 34 |
+
aggregation: !function utils.f1
|
| 35 |
+
higher_is_better: true
|
| 36 |
+
ignore_case: true
|
| 37 |
+
ignore_punctuation: true
|
| 38 |
+
- "."
|
| 39 |
+
- ","
|
| 40 |
+
- "\\$"
|
| 41 |
+
metadata:
|
| 42 |
+
version: 1.0
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_bem.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: bem
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Bemba, while the context is in English or French.Make sure you respond with the
|
| 5 |
+
shortest span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_bem_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_fon.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: fon
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Fon, while the context is in English or French.Make sure you respond with the shortest
|
| 5 |
+
span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_fon_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_hau.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: hau
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Hausa, while the context is in English or French.Make sure you respond with the
|
| 5 |
+
shortest span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_hau_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_ibo.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Igbo, while the context is in English or French.Make sure you respond with the shortest
|
| 5 |
+
span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_ibo_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_kin.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: kin
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Kinyarwanda, while the context is in English or French.Make sure you respond with
|
| 5 |
+
the shortest span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_kin_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_swa.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: swa
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Swahili, while the context is in English or French.Make sure you respond with the
|
| 5 |
+
shortest span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
fewshot_split: test
|
| 14 |
+
fewshot_config:
|
| 15 |
+
sampler: first_n
|
| 16 |
+
task: afriqa_swa_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_twi.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: twi
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Twi, while the context is in English or French.Make sure you respond with the shortest
|
| 5 |
+
span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_twi_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_yor.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Yoruba, while the context is in English or French.Make sure you respond with the
|
| 5 |
+
shortest span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_yor_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/afriqa_zul.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: zul
|
| 3 |
+
doc_to_text: 'Your task is to answer a question given a context. The question is in
|
| 4 |
+
Zulu, while the context is in English or French.Make sure you respond with the shortest
|
| 5 |
+
span in the context that contains the answer.
|
| 6 |
+
|
| 7 |
+
Question: {{question_lang}}
|
| 8 |
+
|
| 9 |
+
Context: {{context}}
|
| 10 |
+
|
| 11 |
+
Answer:'
|
| 12 |
+
include: afriqa
|
| 13 |
+
task: afriqa_zul_prompt_2
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_2/utils.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
import string
|
| 3 |
+
from collections import Counter
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def normalize_answer(s):
|
| 7 |
+
"""
|
| 8 |
+
Taken from the official evaluation script for v1.1 of the SQuAD dataset.
|
| 9 |
+
Lower text and remove punctuation, articles and extra whitespace.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
def remove_articles(text):
|
| 13 |
+
return re.sub(r"\b(a|an|the)\b", " ", text)
|
| 14 |
+
|
| 15 |
+
def white_space_fix(text):
|
| 16 |
+
return " ".join(text.split())
|
| 17 |
+
|
| 18 |
+
def remove_punc(text):
|
| 19 |
+
exclude = set(string.punctuation)
|
| 20 |
+
return "".join(ch for ch in text if ch not in exclude)
|
| 21 |
+
|
| 22 |
+
def lower(text):
|
| 23 |
+
return text.lower()
|
| 24 |
+
|
| 25 |
+
return white_space_fix(remove_articles(remove_punc(lower(s))))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def f1(items):
|
| 29 |
+
"""
|
| 30 |
+
Taken from the official evaluation script for v1.1 of the SQuAD dataset.
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
unzipped_list = list(zip(*items))
|
| 34 |
+
golds = unzipped_list[0]
|
| 35 |
+
preds = unzipped_list[1]
|
| 36 |
+
|
| 37 |
+
f1_list = []
|
| 38 |
+
|
| 39 |
+
for i in range(len(golds)):
|
| 40 |
+
prediction_tokens = normalize_answer(preds[i]).split()
|
| 41 |
+
references_tokens = normalize_answer(golds[i]).split()
|
| 42 |
+
common = Counter(prediction_tokens) & Counter(references_tokens)
|
| 43 |
+
num_same = sum(common.values())
|
| 44 |
+
if num_same == 0:
|
| 45 |
+
f1_score = 0
|
| 46 |
+
else:
|
| 47 |
+
precision = 1.0 * num_same / len(prediction_tokens)
|
| 48 |
+
recall = 1.0 * num_same / len(references_tokens)
|
| 49 |
+
f1_score = (2 * precision * recall) / (precision + recall)
|
| 50 |
+
|
| 51 |
+
f1_list.append(f1_score)
|
| 52 |
+
|
| 53 |
+
return sum(f1_list) / len(f1_list)
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tag:
|
| 2 |
+
- afrobench_xqa_tasks
|
| 3 |
+
- afriqa_prompt_3
|
| 4 |
+
dataset_kwargs: {trust_remote_code: True}
|
| 5 |
+
dataset_path: masakhane/afriqa-gold-passages
|
| 6 |
+
dataset_name: null
|
| 7 |
+
output_type: generate_until
|
| 8 |
+
test_split: test
|
| 9 |
+
fewshot_split: train
|
| 10 |
+
doc_to_target: answer_pivot
|
| 11 |
+
should_decontaminate: true
|
| 12 |
+
doc_to_decontamination_query: question_lang
|
| 13 |
+
generation_kwargs:
|
| 14 |
+
until:
|
| 15 |
+
- "\n"
|
| 16 |
+
do_sample: false
|
| 17 |
+
temperature: 0.0
|
| 18 |
+
filter_list:
|
| 19 |
+
- name: remove_whitespace
|
| 20 |
+
filter:
|
| 21 |
+
- function: remove_whitespace
|
| 22 |
+
- function: take_first
|
| 23 |
+
target_delimiter: " "
|
| 24 |
+
metric_list:
|
| 25 |
+
- metric: exact_match
|
| 26 |
+
aggregation: mean
|
| 27 |
+
higher_is_better: true
|
| 28 |
+
ignore_case: true
|
| 29 |
+
ignore_punctuation: true
|
| 30 |
+
- "."
|
| 31 |
+
- ","
|
| 32 |
+
- "\\$"
|
| 33 |
+
- metric: f1
|
| 34 |
+
aggregation: !function utils.f1
|
| 35 |
+
higher_is_better: true
|
| 36 |
+
ignore_case: true
|
| 37 |
+
ignore_punctuation: true
|
| 38 |
+
- "."
|
| 39 |
+
- ","
|
| 40 |
+
- "\\$"
|
| 41 |
+
metadata:
|
| 42 |
+
version: 1.0
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_bem.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: bem
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_bem_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_fon.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: fon
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_fon_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_hau.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: hau
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_hau_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_ibo.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: ibo
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_ibo_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_kin.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: kin
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_kin_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_swa.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: swa
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
fewshot_split: test
|
| 13 |
+
fewshot_config:
|
| 14 |
+
sampler: first_n
|
| 15 |
+
task: afriqa_swa_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_twi.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: twi
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_twi_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_yor.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: yor
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_yor_prompt_3
|
lm-evaluation-harness/lm_eval/tasks/afrobench/afriqa/prompt_3/afriqa_zul.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by utils.py
|
| 2 |
+
dataset_name: zul
|
| 3 |
+
doc_to_text: 'Given the context, provide the answer to the following question.Ensure
|
| 4 |
+
your response is concise and directly from the context.
|
| 5 |
+
|
| 6 |
+
Question: {{question_lang}}
|
| 7 |
+
|
| 8 |
+
Context: {{context}}
|
| 9 |
+
|
| 10 |
+
Answer:'
|
| 11 |
+
include: afriqa
|
| 12 |
+
task: afriqa_zul_prompt_3
|