Commit 6f4f9e1c authored by lintangsutawika's avatar lintangsutawika
Browse files

resolved merge conflict

parents 0d5748b7 aed90773
"dataset_name": "Patent"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_patent"
"dataset_name": "Political Science and Sociology"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_political_science_and_sociology"
"dataset_name": "Psychology"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_psychology"
"dataset_name": "Public Safety"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_public_safety"
"dataset_name": "Railway and Automotive Engineering"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_railway_and_automotive_engineering"
"dataset_name": "Real Estate"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_real_estate"
"dataset_name": "Refrigerating Machinery"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_refrigerating_machinery"
"dataset_name": "Social Welfare"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_social_welfare"
"dataset_name": "Taxation"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_taxation"
"dataset_name": "Telecommunications and Wireless Technology"
"include": "_default_kmmlu_yaml"
"task": "kmmlu_telecommunications_and_wireless_technology"
import datasets
def process_docs(dataset: datasets.Dataset) -> datasets.Dataset:
def _process_doc(doc):
instruction = (
f"다음을 읽고 정답으로 알맞은 것을 고르시요.\n"
f"### Question: {doc['question']}\n"
f"### Options:\n"
f"(1) {doc['option#1']}\n(2) {doc['option#2']}\n(3) {doc['option#3']}\n(4) {doc['option#4']}\n"
f"### Answer: 주어진 문제의 정답은"
)
out_doc = {
"question": instruction,
"choices": ["(1)", "(2)", "(3)", "(4)"],
"gold": int(doc["answer"]) - 1,
}
return out_doc
return dataset.map(_process_doc)
......@@ -2,6 +2,7 @@ import re
import string
from functools import partial
def parse_choices(doc):
choices = [
c[4:].rstrip(" ,")
......@@ -9,6 +10,7 @@ def parse_choices(doc):
]
return choices
def doc_to_text_base(alphabet, style, doc):
choices = parse_choices(doc)
num = len(choices)
......@@ -24,10 +26,12 @@ def doc_to_text_base(alphabet, style, doc):
)
return doc_to_text
# Full continuation
def choice_A(doc):
return parse_choices(doc)
# Letters only
def choice_B(alphabet, style, doc):
choices = parse_choices(doc)
......@@ -37,6 +41,7 @@ def choice_B(alphabet, style, doc):
letter_list = [letter.replace("\t", "") for letter in letter_list]
return letter_list
# Letters + Full continuation
def choice_C(alphabet, style, doc):
choices = parse_choices(doc)
......@@ -46,6 +51,7 @@ def choice_C(alphabet, style, doc):
letter_list = [letter + " " for letter in letter_list]
return [letter + choice for letter, choice in zip(letter_list, choices)]
template_01 = partial(doc_to_text_base, string.ascii_lowercase, "({})")
choice_01a = choice_A
choice_01b = partial(choice_B, string.ascii_lowercase, "({})")
......
......@@ -19,5 +19,6 @@ metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
num_fewshot: 0
metadata:
- version: 0.0
......@@ -15,4 +15,3 @@ task:
# - mmlu_alt_pv_03_other
# - mmlu_alt_pv_03_social_sciences
# - mmlu_alt_pv_03_humanities
......@@ -15,6 +15,7 @@ generation_kwargs:
- "</s>"
do_sample: false
temperature: 0.0
num_fewshot: 0
metric_list:
- metric: exact_match
aggregation: mean
......
......@@ -15,6 +15,7 @@ generation_kwargs:
- "</s>"
do_sample: false
temperature: 0.0
num_fewshot: 0
metric_list:
- metric: exact_match
aggregation: mean
......
......@@ -2,4 +2,4 @@ include: ../_sciq_alt_yaml
group: sciq_alt_ov_01
task: sciq_alt_ov_01a
doc_to_text: !function ../styles.template_01
doc_to_choice: !function ../styles.choice_01a
\ No newline at end of file
doc_to_choice: !function ../styles.choice_01a
......@@ -2,4 +2,4 @@ include: ../_sciq_alt_yaml
group: sciq_alt_ov_01
task: sciq_alt_ov_01b
doc_to_text: !function ../styles.template_01
doc_to_choice: !function ../styles.choice_01b
\ No newline at end of file
doc_to_choice: !function ../styles.choice_01b
......@@ -2,4 +2,4 @@ include: ../_sciq_alt_yaml
group: sciq_alt_ov_01
task: sciq_alt_ov_01c
doc_to_text: !function ../styles.template_01
doc_to_choice: !function ../styles.choice_01c
\ No newline at end of file
doc_to_choice: !function ../styles.choice_01c
......@@ -2,4 +2,4 @@ include: ../_sciq_alt_yaml
group: sciq_alt_ov_02
task: sciq_alt_ov_02a
doc_to_text: !function ../styles.template_02
doc_to_choice: !function ../styles.choice_02a
\ No newline at end of file
doc_to_choice: !function ../styles.choice_02a
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