Commit 5699c7ab authored by lintangsutawika's avatar lintangsutawika
Browse files

update winogrande format

parent b7449cd9
def doc_to_text(doc):
idx = doc["sentence"].index("_")
options = [doc["option1"], doc["option2"]]
return [doc["sentence"][:idx] + opt for opt in options]
answer_to_num = {"1": 0, "2": 1}
return answer_to_num[doc["answer"]]
def doc_to_target(doc):
......@@ -9,6 +8,7 @@ def doc_to_target(doc):
return doc["sentence"][idx:].strip()
def gold_alias(doc):
answer_to_num = {"1": 0, "2": 1}
return answer_to_num[doc["answer"]]
def doc_to_choice(doc):
idx = doc["sentence"].index("_")
options = [doc["option1"], doc["option2"]]
return [doc["sentence"][:idx] + opt for opt in options]
......@@ -4,9 +4,9 @@ dataset_name: winogrande_xl
output_type: multiple_choice
training_split: train
validation_split: validation
doc_to_target: !function preprocess_winogrande.doc_to_target
doc_to_text: !function preprocess_winogrande.doc_to_text
gold_alias: !function preprocess_winogrande.gold_alias
doc_to_target: !function preprocess_winogrande.doc_to_target
doc_to_choice: !function preprocess_winogrande.doc_to_choice
metric_list:
- metric: acc
aggregation: mean
......
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