Commit d7e32489 authored by thomasw21's avatar thomasw21
Browse files

Pretty sure questions need to be paragraph dependent also

parent 0bde7589
...@@ -52,13 +52,14 @@ def acc_all(items): ...@@ -52,13 +52,14 @@ def acc_all(items):
docs = list(zip(*items))[1] docs = list(zip(*items))[1]
for doc, pred in zip(docs, preds): for doc, pred in zip(docs, preds):
paragraph_id = doc["idx"]["paragraph"]
question_id = doc["idx"]["question"] question_id = doc["idx"]["question"]
if question_id not in question_scoring_dict: if (paragraph_id, question_id) not in question_scoring_dict:
question_scoring_dict[question_id] = [] question_scoring_dict[(paragraph_id, question_id)] = []
gold_label = doc["label"] == 1 gold_label = doc["label"] == 1
question_scoring_dict[question_id].append(gold_label == pred)
question_scoring_dict[(paragraph_id, question_id)].append(gold_label == pred)
acc = np.mean([int(all(x)) for x in question_scoring_dict.values()]) acc = np.mean([int(all(x)) for x in question_scoring_dict.values()])
return acc return acc
......
...@@ -202,7 +202,7 @@ class Copa(HFTask): ...@@ -202,7 +202,7 @@ class Copa(HFTask):
class MultiRC(HFTask): class MultiRC(HFTask):
VERSION = 0 VERSION = 1
DATASET_PATH = "super_glue" DATASET_PATH = "super_glue"
DATASET_NAME = "multirc" DATASET_NAME = "multirc"
......
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