Commit df1fc6c3 authored by thomasw21's avatar thomasw21
Browse files

Fix multirc

parent f16e8b5c
...@@ -228,7 +228,7 @@ class MultiRC(HFTask): ...@@ -228,7 +228,7 @@ class MultiRC(HFTask):
@staticmethod @staticmethod
def format_answer(answer, label): def format_answer(answer, label):
label_str = "yes" if label else "no" label_str = "yes" if label else "no"
return f"{label_str}, {answer}" return f"{answer}\nIs the answer correct? {label_str}"
def construct_requests(self, doc, ctx): def construct_requests(self, doc, ctx):
true_choice = self.format_answer(answer=doc["answer"], label=True) true_choice = self.format_answer(answer=doc["answer"], label=True)
...@@ -240,7 +240,8 @@ class MultiRC(HFTask): ...@@ -240,7 +240,8 @@ class MultiRC(HFTask):
return ll_true_choice, ll_false_choice return ll_true_choice, ll_false_choice
def process_results(self, doc, results): def process_results(self, doc, results):
pred = np.argmax(results) ll_true_choice, ll_false_choice = results
pred = ll_true_choice > ll_false_choice
return { return {
"acc": (pred, doc) "acc": (pred, doc)
} }
......
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