From 8bb489c3c723cea7ee026d3c24043294004368d2 Mon Sep 17 00:00:00 2001 From: kmt Date: Fri, 4 Feb 2022 11:16:09 -0800 Subject: [PATCH] add templates for riddle_sense dataset (#723) * add templates for riddle_sense dataset Use almost identical templates as commonsense_qa because the two datasets are very similar. * moving `{% if answerKey != "" %}` to the target Co-authored-by: Victor Sanh --- .../templates/riddle_sense/templates.yaml | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 promptsource/templates/riddle_sense/templates.yaml diff --git a/promptsource/templates/riddle_sense/templates.yaml b/promptsource/templates/riddle_sense/templates.yaml new file mode 100644 index 000000000..773dccb69 --- /dev/null +++ b/promptsource/templates/riddle_sense/templates.yaml @@ -0,0 +1,116 @@ +dataset: riddle_sense +templates: + 3df2405b-4a0e-4fcf-8600-b7f4843b945a: !Template + answer_choices: null + id: 3df2405b-4a0e-4fcf-8600-b7f4843b945a + jinja: 'Use the following options to predict a possible question for them: + + + {% for i in range(choices[''text'']|length) %} + + - {{choices[''text''][i]}} + + {% endfor %} ||| + + {{question}}' + metadata: !TemplateMetadata + choices_in_prompt: false + metrics: + - BLEU + - ROUGE + original_task: false + name: answer_to_question + reference: '' + 8b44338c-f635-47fc-86fb-3135ef2a76ae: !Template + answer_choices: '{{choices.text | join("|||")}}' + id: 8b44338c-f635-47fc-86fb-3135ef2a76ae + jinja: 'Given the options below, select the most suitable answer for the following + question: + + {{question}} + + Options: + + - {{answer_choices | join("\n- ")}}||| + + {% if answerKey != "" %} + + {{answer_choices[choices["label"].index(answerKey)]}} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: true + name: most_suitable_answer + reference: '' + ac002734-5b1f-4478-9ffc-f16d9ca2f70e: !Template + answer_choices: '{{choices.text | join("|||")}}' + id: ac002734-5b1f-4478-9ffc-f16d9ca2f70e + jinja: 'Answer the following question: + + {{question}} ||| + + {% if answerKey != "" %} + + {{ answer_choices[choices[''label''].index(answerKey)] }} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: false + metrics: + - Accuracy + original_task: true + name: answer_given_question_without_options + reference: '' + bf3f7bd2-91c6-455c-b9f7-42ce265fa2db: !Template + answer_choices: A ||| B ||| C ||| D ||| E + id: bf3f7bd2-91c6-455c-b9f7-42ce265fa2db + jinja: 'Given the following options, what do you think is the correct answer to + the question below: + + + {{question}} + + + Options: + + {% for letter, t in zip(answer_choices, choices.text) %} + + - {{letter}}: {{t}} + + {% endfor %} ||| + + {% if answerKey != "" %} + + {{answerKey}} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: true + name: question_to_answer_index + reference: '' + bf7d7cbc-aa05-4aca-97ff-29eb34502019: !Template + answer_choices: '{{choices.text | join("|||")}}' + id: bf7d7cbc-aa05-4aca-97ff-29eb34502019 + jinja: '{{question}} + + + - {{answer_choices | join("\n- ")}} ||| + + {% if answerKey != "" %} + + {{answer_choices[choices[''label''].index(answerKey)] }} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: true + name: question_answering + reference: ''