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

resolved merge conflict

parents 0d5748b7 aed90773
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n" "description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n"
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_01_zeroshot_ruin_names" "task": "bbh_alt_pv_01_zeroshot_ruin_names"
"process_docs": !function ../../utils.fix_ruin_names "process_docs": !function ../../utils.fix_ruin_names
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_01_zeroshot_sports_understanding" "task": "bbh_alt_pv_01_zeroshot_sports_understanding"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["yes", "no"] "doc_to_choice": ["yes", "no"]
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_01_zeroshot_web_of_lies" "task": "bbh_alt_pv_01_zeroshot_web_of_lies"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["Yes", "No"] "doc_to_choice": ["Yes", "No"]
\ No newline at end of file
...@@ -9,4 +9,4 @@ num_fewshot: 0 ...@@ -9,4 +9,4 @@ num_fewshot: 0
metric_list: metric_list:
- metric: acc - metric: acc
- metric: acc_norm - metric: acc_norm
- metric: brier_score - metric: brier_score
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_02_zeroshot_formal_fallacies" "task": "bbh_alt_pv_02_zeroshot_formal_fallacies"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["valid", "invalid"] "doc_to_choice": ["valid", "invalid"]
\ No newline at end of file
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"description": "Recommend movies similar to the given list of movies.\n\n" "description": "Recommend movies similar to the given list of movies.\n\n"
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_02_zeroshot_movie_recommendation" "task": "bbh_alt_pv_02_zeroshot_movie_recommendation"
"process_docs": !function ../../utils.fix_movie_recommendation "process_docs": !function ../../utils.fix_movie_recommendation
\ No newline at end of file
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n" "description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n"
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_02_zeroshot_ruin_names" "task": "bbh_alt_pv_02_zeroshot_ruin_names"
"process_docs": !function ../../utils.fix_ruin_names "process_docs": !function ../../utils.fix_ruin_names
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_02_zeroshot_sports_understanding" "task": "bbh_alt_pv_02_zeroshot_sports_understanding"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["yes", "no"] "doc_to_choice": ["yes", "no"]
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_02_zeroshot_web_of_lies" "task": "bbh_alt_pv_02_zeroshot_web_of_lies"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["Yes", "No"] "doc_to_choice": ["Yes", "No"]
\ No newline at end of file
...@@ -9,4 +9,4 @@ num_fewshot: 0 ...@@ -9,4 +9,4 @@ num_fewshot: 0
metric_list: metric_list:
- metric: acc - metric: acc
- metric: acc_norm - metric: acc_norm
- metric: brier_score - metric: brier_score
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_03_zeroshot_formal_fallacies" "task": "bbh_alt_pv_03_zeroshot_formal_fallacies"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["valid", "invalid"] "doc_to_choice": ["valid", "invalid"]
\ No newline at end of file
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"description": "Recommend movies similar to the given list of movies.\n\n" "description": "Recommend movies similar to the given list of movies.\n\n"
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_03_zeroshot_movie_recommendation" "task": "bbh_alt_pv_03_zeroshot_movie_recommendation"
"process_docs": !function ../../utils.fix_movie_recommendation "process_docs": !function ../../utils.fix_movie_recommendation
\ No newline at end of file
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n" "description": "Select the humorous edit that 'ruins' the input movie or musical artist name.\n\n"
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_03_zeroshot_ruin_names" "task": "bbh_alt_pv_03_zeroshot_ruin_names"
"process_docs": !function ../../utils.fix_ruin_names "process_docs": !function ../../utils.fix_ruin_names
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_03_zeroshot_sports_understanding" "task": "bbh_alt_pv_03_zeroshot_sports_understanding"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["yes", "no"] "doc_to_choice": ["yes", "no"]
\ No newline at end of file
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"include": "_zeroshot_template_yaml" "include": "_zeroshot_template_yaml"
"task": "bbh_alt_pv_03_zeroshot_web_of_lies" "task": "bbh_alt_pv_03_zeroshot_web_of_lies"
"doc_to_target": target "doc_to_target": target
"doc_to_choice": ["Yes", "No"] "doc_to_choice": ["Yes", "No"]
\ No newline at end of file
...@@ -3,6 +3,7 @@ import string ...@@ -3,6 +3,7 @@ import string
yes_no = ["Yes", "No"] yes_no = ["Yes", "No"]
def parse_choices(doc): def parse_choices(doc):
input_text = doc["input"] input_text = doc["input"]
...@@ -20,8 +21,9 @@ def parse_choices(doc): ...@@ -20,8 +21,9 @@ def parse_choices(doc):
else: else:
return [] return []
def styles_01(doc): def styles_01(doc):
#Check for choices and remove them # Check for choices and remove them
choices = parse_choices(doc) choices = parse_choices(doc)
if choices != []: if choices != []:
doc_to_text = doc["input"].split("Options:")[0] doc_to_text = doc["input"].split("Options:")[0]
...@@ -31,19 +33,23 @@ def styles_01(doc): ...@@ -31,19 +33,23 @@ def styles_01(doc):
doc_to_text = doc["input"] doc_to_text = doc["input"]
return doc_to_text return doc_to_text
def styles_02(doc): def styles_02(doc):
#Check for choices and remove them # Check for choices and remove them
doc_to_text = styles_01(doc) doc_to_text = styles_01(doc)
return "Q: "+doc_to_text+"\nA:" return "Q: " + doc_to_text + "\nA:"
def styles_03(doc): def styles_03(doc):
#Check for choices and remove them # Check for choices and remove them
doc_to_text = styles_01(doc) doc_to_text = styles_01(doc)
return "Question: "+doc_to_text+"\nAnswer:" return "Question: " + doc_to_text + "\nAnswer:"
def doc_to_choice(doc): def doc_to_choice(doc):
return parse_choices(doc) return parse_choices(doc)
def doc_to_target(doc): def doc_to_target(doc):
target = doc["target"] target = doc["target"]
try: try:
...@@ -61,4 +67,6 @@ def doc_to_target(doc): ...@@ -61,4 +67,6 @@ def doc_to_target(doc):
print(parse_choices(doc)) print(parse_choices(doc))
print("Error") print("Error")
print(err) print(err)
import sys; sys.exit() import sys
\ No newline at end of file
sys.exit()
# For fixing line 163 in `movie_recommendation` # For fixing line 163 in `movie_recommendation`
def fix_movie_recommendation(data):
def fix_movie_recommendation(data):
def _fix(doc): def _fix(doc):
if doc["target"] == "Monsters, Inc": if doc["target"] == "Monsters, Inc":
doc["input"] = "Find a movie similar to Minority Report, Shrek, Catch Me If You Can, Aladdin:\nOptions:\n(A) Monsters, Inc\n(B) Children of the Night\n(C) The Incredible Shrinking Man\n(D) Town & Country" doc[
"input"
] = "Find a movie similar to Minority Report, Shrek, Catch Me If You Can, Aladdin:\nOptions:\n(A) Monsters, Inc\n(B) Children of the Night\n(C) The Incredible Shrinking Man\n(D) Town & Country"
doc["target"] = "(A)" doc["target"] = "(A)"
return doc return doc
return data.map(_fix) return data.map(_fix)
def fix_ruin_names(data):
def fix_ruin_names(data):
def _fix(doc): def _fix(doc):
if doc["target"] == "dearth, wind, & fire": if doc["target"] == "dearth, wind, & fire":
doc["input"] = "Which of the following is a humorous edit of this artist or movie name: 'earth, wind, & fire'?\nOptions:\n(A) eareth, wind, & fire\n(B) earth, bind, & fire\n(C) earthm wind, & fire\n(D) dearth, wind, & fire" doc[
"input"
] = "Which of the following is a humorous edit of this artist or movie name: 'earth, wind, & fire'?\nOptions:\n(A) eareth, wind, & fire\n(B) earth, bind, & fire\n(C) earthm wind, & fire\n(D) dearth, wind, & fire"
doc["target"] = "(D)" doc["target"] = "(D)"
elif doc["target"] == "rita, sue and bob poo": elif doc["target"] == "rita, sue and bob poo":
doc["input"] = "Which of the following is a humorous edit of this artist or movie name: 'rita, sue and bob too'?\nOptions:\n(A) rita, sue and bob too\n(B) rita, sue and bob poo\n(C) rita, sue and box too\n(D) rita,y sue and bob too" doc[
"input"
] = "Which of the following is a humorous edit of this artist or movie name: 'rita, sue and bob too'?\nOptions:\n(A) rita, sue and bob too\n(B) rita, sue and bob poo\n(C) rita, sue and box too\n(D) rita,y sue and bob too"
doc["target"] = "(B)" doc["target"] = "(B)"
return doc return doc
return data.map(_fix) return data.map(_fix)
\ No newline at end of file
...@@ -24,5 +24,6 @@ filter_list: ...@@ -24,5 +24,6 @@ filter_list:
- function: "regex" - function: "regex"
regex_pattern: "(?<=the answer is )(.*)(?=.)" regex_pattern: "(?<=the answer is )(.*)(?=.)"
- function: "take_first" - function: "take_first"
num_fewshot: 0
metadata: metadata:
- version: 0.0 - version: 0.0
...@@ -22,5 +22,6 @@ filter_list: ...@@ -22,5 +22,6 @@ filter_list:
- function: "regex" - function: "regex"
regex_pattern: "((?<=The answer is )(.*)(?=.)|(?<=the answer is )(.*)(?=.)|(?<=The answer: )(.*)(?=.)|(?<=The final answer: )(.*)(?=.))" regex_pattern: "((?<=The answer is )(.*)(?=.)|(?<=the answer is )(.*)(?=.)|(?<=The answer: )(.*)(?=.)|(?<=The final answer: )(.*)(?=.))"
- function: "take_first" - function: "take_first"
num_fewshot: 0
metadata: metadata:
- version: 0 - version: 0
...@@ -16,5 +16,6 @@ generation_kwargs: ...@@ -16,5 +16,6 @@ generation_kwargs:
- "\n\n" - "\n\n"
do_sample: false do_sample: false
temperature: 0.0 temperature: 0.0
num_fewshot: 0
metadata: metadata:
- version: 0 - version: 0
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