Commit 601be343 authored by Baber's avatar Baber
Browse files

Merge branch 'main' into feature/eval_from_config

parents d0884a96 68c3a811
# Generated by utils.py
dataset_name: lin
include: afrimmlu_translate
task: afrimmlu_translate_lin_prompt_2
# Generated by utils.py
dataset_name: lug
include: afrimmlu_translate
task: afrimmlu_translate_lug_prompt_2
# Generated by utils.py
dataset_name: orm
include: afrimmlu_translate
task: afrimmlu_translate_orm_prompt_2
# Generated by utils.py
dataset_name: sna
include: afrimmlu_translate
task: afrimmlu_translate_sna_prompt_2
# Generated by utils.py
dataset_name: sot
include: afrimmlu_translate
task: afrimmlu_translate_sot_prompt_2
# Generated by utils.py
dataset_name: swa
include: afrimmlu_translate
task: afrimmlu_translate_swa_prompt_2
# Generated by utils.py
dataset_name: twi
include: afrimmlu_translate
task: afrimmlu_translate_twi_prompt_2
# Generated by utils.py
dataset_name: wol
include: afrimmlu_translate
task: afrimmlu_translate_wol_prompt_2
# Generated by utils.py
dataset_name: xho
include: afrimmlu_translate
task: afrimmlu_translate_xho_prompt_2
# Generated by utils.py
dataset_name: yor
include: afrimmlu_translate
task: afrimmlu_translate_yor_prompt_2
# Generated by utils.py
dataset_name: zul
include: afrimmlu_translate
task: afrimmlu_translate_zul_prompt_2
from lm_eval.utils import weighted_f1_score
def doc_to_choice(doc):
choices = eval(doc["choices"])
return choices
def doc_to_text(doc):
output = """As an expert in {subject}, choose the most accurate answer to the question below.
Your goal is to select the correct option 'A', 'B', 'C', or 'D' by understanding the nuances of the topic.
Question: {question}
Choices:
A: {choice1}
B: {choice2}
C: {choice3}
D: {choice4}
Answer: """
choices = eval(doc["choices"])
text = output.format(
subject=doc["subject"],
question=doc["question"],
choice1=choices[0],
choice2=choices[1],
choice3=choices[2],
choice4=choices[3],
)
return text
tag: afrimmlu_tt_tasks
dataset_path: masakhane/afrimmlu-translate-test
dataset_name: null
output_type: multiple_choice
test_split: test
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
# Generated by utils.py
dataset_name: amh
include: afrimmlu_translate
task: afrimmlu_translate_amh_prompt_3
# Generated by utils.py
dataset_name: ewe
include: afrimmlu_translate
task: afrimmlu_translate_ewe_prompt_3
# Generated by utils.py
dataset_name: fra
include: afrimmlu_translate
task: afrimmlu_translate_fra_prompt_3
# Generated by utils.py
dataset_name: hau
include: afrimmlu_translate
task: afrimmlu_translate_hau_prompt_3
# Generated by utils.py
dataset_name: ibo
include: afrimmlu_translate
task: afrimmlu_translate_ibo_prompt_3
# Generated by utils.py
dataset_name: kin
include: afrimmlu_translate
task: afrimmlu_translate_kin_prompt_3
# Generated by utils.py
dataset_name: lin
include: afrimmlu_translate
task: afrimmlu_translate_lin_prompt_3
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