Unverified Commit 78a215e0 authored by Lintang Sutawika's avatar Lintang Sutawika Committed by GitHub
Browse files

Bigbench fix (#1686)



* edit process multiple-choice

* split template yaml

* remove

* modified multiple_choice tasks

* udpate

* Update multiple_choice_template_b_yaml

* Update multiple_choice_template_a_yaml

---------
Co-authored-by: default avatarHailey Schoelkopf <65563625+haileyschoelkopf@users.noreply.github.com>
parent f2ea37e3
import os import os
import datasets
import yaml import yaml
...@@ -173,6 +174,11 @@ all_subtasks = [ ...@@ -173,6 +174,11 @@ all_subtasks = [
"word_unscrambling", "word_unscrambling",
] ]
skip_tasks = [
"simple_arithmetic_json_multiple_choice",
"simple_arithmetic_multiple_targets_json",
]
def main() -> None: def main() -> None:
for path, task_type in zip( for path, task_type in zip(
...@@ -183,11 +189,29 @@ def main() -> None: ...@@ -183,11 +189,29 @@ def main() -> None:
for task in all_subtasks: for task in all_subtasks:
file_name = f"{task}.yaml" file_name = f"{task}.yaml"
try: try:
template_file = task_type
if path == "multiple_choice":
print(f"Checking {task} for multiple choices")
if task in skip_tasks:
continue
data = datasets.load_dataset("hails/bigbench", task + "_zero_shot")
multiple_choice_targets = data["default"][0][
"multiple_choice_targets"
]
if len(multiple_choice_targets) == 0:
continue
else:
template_file = "multiple_choice_template_b_yaml"
if set(data["default"][0]["targets"]) < set(
multiple_choice_targets
):
template_file = "multiple_choice_template_a_yaml"
with open(f"{path}/{file_name}", "w", encoding="utf-8") as f: with open(f"{path}/{file_name}", "w", encoding="utf-8") as f:
f.write("# Generated by utils.py\n") f.write("# Generated by utils.py\n")
yaml.dump( yaml.dump(
{ {
"include": f"../{task_type}", "include": f"../{template_file}",
"task": "bigbench_" "task": "bigbench_"
+ task + task
+ "_{}".format(task_type.split("_template_yaml")[0]), + "_{}".format(task_type.split("_template_yaml")[0]),
......
# Generated by utils.py # Generated by utils.py
dataset_name: abstract_narrative_understanding_zero_shot dataset_name: abstract_narrative_understanding_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_abstract_narrative_understanding_multiple_choice task: bigbench_abstract_narrative_understanding_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: anachronisms_zero_shot dataset_name: anachronisms_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_anachronisms_multiple_choice task: bigbench_anachronisms_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: analogical_similarity_zero_shot dataset_name: analogical_similarity_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_analogical_similarity_multiple_choice task: bigbench_analogical_similarity_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: analytic_entailment_zero_shot dataset_name: analytic_entailment_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_analytic_entailment_multiple_choice task: bigbench_analytic_entailment_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: arithmetic_zero_shot dataset_name: arithmetic_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_arithmetic_multiple_choice task: bigbench_arithmetic_multiple_choice
# Generated by utils.py
dataset_name: ascii_word_recognition_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_ascii_word_recognition_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: authorship_verification_zero_shot dataset_name: authorship_verification_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_authorship_verification_multiple_choice task: bigbench_authorship_verification_multiple_choice
# Generated by utils.py
dataset_name: auto_categorization_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_auto_categorization_multiple_choice
# Generated by utils.py
dataset_name: auto_debugging_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_auto_debugging_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: bbq_lite_json_zero_shot dataset_name: bbq_lite_json_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_bbq_lite_json_multiple_choice task: bigbench_bbq_lite_json_multiple_choice
# Generated by utils.py
dataset_name: bridging_anaphora_resolution_barqa_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_bridging_anaphora_resolution_barqa_multiple_choice
# Generated by utils.py
dataset_name: causal_judgment_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_causal_judgement_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: causal_judgment_zero_shot dataset_name: causal_judgment_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_causal_judgment_multiple_choice task: bigbench_causal_judgment_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: cause_and_effect_zero_shot dataset_name: cause_and_effect_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_cause_and_effect_multiple_choice task: bigbench_cause_and_effect_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: checkmate_in_one_zero_shot dataset_name: checkmate_in_one_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_checkmate_in_one_multiple_choice task: bigbench_checkmate_in_one_multiple_choice
# Generated by utils.py
dataset_name: chess_state_tracking_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_chess_state_tracking_multiple_choice
# Generated by utils.py
dataset_name: chinese_remainder_theorem_zero_shot
include: ../multiple_choice_template_yaml
task: bigbench_chinese_remainder_theorem_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: cifar10_classification_zero_shot dataset_name: cifar10_classification_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_cifar10_classification_multiple_choice task: bigbench_cifar10_classification_multiple_choice
# Generated by utils.py # Generated by utils.py
dataset_name: code_line_description_zero_shot dataset_name: code_line_description_zero_shot
include: ../multiple_choice_template_yaml include: ../multiple_choice_template_a_yaml
task: bigbench_code_line_description_multiple_choice task: bigbench_code_line_description_multiple_choice
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