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

update winogrande format

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