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

resolved merge conflict

parents 0d5748b7 aed90773
...@@ -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
......
...@@ -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