Commit bbb8386c authored by lintangsutawika's avatar lintangsutawika
Browse files

removed alt worlds prompts

parent 3e5e9da2
include: ../_hellaswag_alt_yaml
group: hellaswag_03
group_alias: style_03
task: hellaswag_03c
task_alias: c
doc_to_text: !function ../styles.template_03
doc_to_choice: !function ../styles.choice_03c
include: ../_hellaswag_alt_yaml
group: hellaswag_04
group_alias: style_04
task: hellaswag_04a
task_alias: a
doc_to_text: !function ../styles.template_04
doc_to_choice: !function ../styles.choice_04a
include: ../_hellaswag_alt_yaml
group: hellaswag_04
group_alias: style_04
task: hellaswag_04b
task_alias: b
doc_to_text: !function ../styles.template_04
doc_to_choice: !function ../styles.choice_04b
include: ../_hellaswag_alt_yaml
group: hellaswag_04
group_alias: style_04
task: hellaswag_04c
task_alias: c
doc_to_text: !function ../styles.template_04
doc_to_choice: !function ../styles.choice_04c
include: ../_hellaswag_alt_yaml
group: hellaswag_05
group_alias: style_05
task: hellaswag_05a
task_alias: a
doc_to_text: !function ../styles.template_05
doc_to_choice: !function ../styles.choice_05a
include: ../_hellaswag_alt_yaml
group: hellaswag_05
group_alias: style_05
task: hellaswag_05b
task_alias: b
doc_to_text: !function ../styles.template_05
doc_to_choice: !function ../styles.choice_05b
include: ../_hellaswag_alt_yaml
group: hellaswag_05
group_alias: style_05
task: hellaswag_05c
task_alias: c
doc_to_text: !function ../styles.template_05
doc_to_choice: !function ../styles.choice_05c
include: ../_hellaswag_alt_yaml
group: hellaswag_06
group_alias: style_06
task: hellaswag_06a
task_alias: a
doc_to_text: !function ../styles.template_06
doc_to_choice: !function ../styles.choice_06a
include: ../_hellaswag_alt_yaml
group: hellaswag_06
group_alias: style_06
task: hellaswag_06b
task_alias: b
doc_to_text: !function ../styles.template_06
doc_to_choice: !function ../styles.choice_06b
include: ../_hellaswag_alt_yaml
group: hellaswag_06
group_alias: style_06
task: hellaswag_06c
task_alias: c
doc_to_text: !function ../styles.template_06
doc_to_choice: !function ../styles.choice_06c
include: ../_hellaswag_alt_yaml
group: hellaswag_07
group_alias: style_07
task: hellaswag_07a
task_alias: a
doc_to_text: !function ../styles.template_07
doc_to_choice: !function ../styles.choice_07a
include: ../_hellaswag_alt_yaml
group: hellaswag_07
group_alias: style_07
task: hellaswag_07b
task_alias: b
doc_to_text: !function ../styles.template_07
doc_to_choice: !function ../styles.choice_07b
include: ../_hellaswag_alt_yaml
group: hellaswag_07
group_alias: style_07
task: hellaswag_07c
task_alias: c
doc_to_text: !function ../styles.template_07
doc_to_choice: !function ../styles.choice_07c
include: ../_hellaswag_alt_yaml
group: hellaswag_08
group_alias: style_08
task: hellaswag_08a
task_alias: a
doc_to_text: !function ../styles.template_08
doc_to_choice: !function ../styles.choice_08a
include: ../_hellaswag_alt_yaml
group: hellaswag_08
group_alias: style_08
task: hellaswag_08b
task_alias: b
doc_to_text: !function ../styles.template_08
doc_to_choice: !function ../styles.choice_08b
include: ../_hellaswag_alt_yaml
group: hellaswag_08
group_alias: style_08
task: hellaswag_08c
task_alias: c
doc_to_text: !function ../styles.template_08
doc_to_choice: !function ../styles.choice_08c
import string
from functools import partial
def doc_to_text_base(alphabet, style, doc):
choices = doc["choices"]
num = len(choices)
letter_list = [style.format(letter) for letter in alphabet[0:num]]
if "\t" in style:
choice_string = "{}{}"
else:
choice_string = "{} {}"
doc_to_text = "\n\n".join(
[
doc["query"] + "...",
" What is the most appropriate continuation?",
]
+ [choice_string.format(i, j) for i, j in zip(letter_list, choices)]
)
return doc_to_text
# Full continuation
def choice_A(doc):
return doc["choices"]
# Letters only
def choice_B(alphabet, style, doc):
choices = doc["choices"]
num = len(choices)
letter_list = [style.format(letter) for letter in alphabet[0:num]]
if "\t" in style:
letter_list = [letter.replace("\t", "") for letter in letter_list]
return letter_list
# Letters + Full continuation
def choice_C(alphabet, style, doc):
choices = doc["choices"]
num = len(choices)
letter_list = [style.format(letter) for letter in alphabet[0:num]]
if "\t" not in style:
letter_list = [letter + " " for letter in letter_list]
return [letter + choice for letter, choice in zip(letter_list, doc["choices"])]
template_01 = partial(doc_to_text_base, string.ascii_lowercase, "({})")
choice_01a = choice_A
choice_01b = partial(choice_B, string.ascii_lowercase, "({})")
choice_01c = partial(choice_C, string.ascii_lowercase, "({})")
template_02 = partial(doc_to_text_base, string.ascii_lowercase, "{})")
choice_02a = choice_A
choice_02b = partial(choice_B, string.ascii_lowercase, "{})")
choice_02c = partial(choice_C, string.ascii_lowercase, "{})")
template_03 = partial(doc_to_text_base, string.ascii_lowercase, "{}.")
choice_03a = choice_A
choice_03b = partial(choice_B, string.ascii_lowercase, "{}.")
choice_03c = partial(choice_C, string.ascii_lowercase, "{}.")
template_04 = partial(doc_to_text_base, string.ascii_lowercase, "{}\t")
choice_04a = choice_A
choice_04b = partial(choice_B, string.ascii_lowercase, "{}\t")
choice_04c = partial(choice_C, string.ascii_lowercase, "{}\t")
template_05 = partial(doc_to_text_base, string.ascii_uppercase, "({})")
choice_05a = choice_A
choice_05b = partial(choice_B, string.ascii_uppercase, "({})")
choice_05c = partial(choice_C, string.ascii_uppercase, "({})")
template_06 = partial(doc_to_text_base, string.ascii_uppercase, "{})")
choice_06a = choice_A
choice_06b = partial(choice_B, string.ascii_uppercase, "{})")
choice_06c = partial(choice_C, string.ascii_uppercase, "{})")
template_07 = partial(doc_to_text_base, string.ascii_uppercase, "{}.")
choice_07a = choice_A
choice_07b = partial(choice_B, string.ascii_uppercase, "{}.")
choice_07c = partial(choice_C, string.ascii_uppercase, "{}.")
template_08 = partial(doc_to_text_base, string.ascii_uppercase, "{}\t")
choice_08a = choice_A
choice_08b = partial(choice_B, string.ascii_uppercase, "{}\t")
choice_08c = partial(choice_C, string.ascii_uppercase, "{}\t")
Investigate affect of letter options
- (A)
- A)
- A.
- A\t
- (a)
- a)
- a.
- a\t
Answer types:
- letters only
- original option
- just letter
- letters + continuation
- original option
- just letter
- continuation
dataset_path: math_qa
output_type: multiple_choice
training_split: train
validation_split: validation
test_split: test
doc_to_target: "{{['a', 'b', 'c', 'd', 'e'].index(correct)}}"
metric_list:
- metric: acc
- metric: acc_norm
- metric: brier_score
group: mathqa_alt_ov
task:
- mathqa_alt_ov_01
- mathqa_alt_ov_02
- mathqa_alt_ov_03
- mathqa_alt_ov_04
- mathqa_alt_ov_05
- mathqa_alt_ov_06
- mathqa_alt_ov_07
- mathqa_alt_ov_08
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