From 543d6b640915490690a361e77fbe9882f04f6a0a Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Wed, 29 Dec 2021 16:41:00 +0900 Subject: [PATCH 1/4] Finish asset-simplification --- .../asset/simplification/templates.yaml | 149 ++++++++++++++++-- 1 file changed, 133 insertions(+), 16 deletions(-) diff --git a/promptsource/templates/asset/simplification/templates.yaml b/promptsource/templates/asset/simplification/templates.yaml index 5ccaa093d..616f44932 100644 --- a/promptsource/templates/asset/simplification/templates.yaml +++ b/promptsource/templates/asset/simplification/templates.yaml @@ -4,38 +4,155 @@ templates: 0f0e55f9-28b4-4844-b65d-b9544a0918eb: !Template answer_choices: null id: 0f0e55f9-28b4-4844-b65d-b9544a0918eb - jinja: "{{original}}\n\nHow would I say this in another way? \n\n|||\n\n{{simplifications\ - \ | choice}}" + jinja: "{% set real_simplifications = [] %}{% for text in simplifications %}{%\ + \ if text|length < original|length %}{{real_simplifications.append(text) | default(\"\ + \", True)}}{% endif %}{% endfor %}\n{% if real_simplifications %}\nText: {{original}}\n\ + \nHow would I simplify this? \n\n|||\n\n{{real_simplifications | choice}}\n\ + {% endif %}" metadata: !TemplateMetadata - choices_in_prompt: null - metrics: [] + choices_in_prompt: false + metrics: + - BLEU + - ROUGE original_task: true - name: asset_simplification1 + name: verbose-to-simplification reference: Rewrite text using one random simplification 3cbfbc1c-6876-4dd7-b7db-45fb3233a667: !Template answer_choices: null id: 3cbfbc1c-6876-4dd7-b7db-45fb3233a667 - jinja: "{{simplifications | choice}}\n\nHow would I say this in another way? \n\ - \n|||\n\n{{original}}" + jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% + if text|length < original|length %}{{real_simplifications.append(text) | default("", + True)}}{% endif %}{% endfor %} + + {% if real_simplifications %} + + Make the below sentence more verbose: + + + {{real_simplifications | choice}} + + + ||| + + + {{original}} + + {% endif %}' metadata: !TemplateMetadata - choices_in_prompt: null - metrics: [] + choices_in_prompt: false + metrics: + - BLEU + - ROUGE original_task: false - name: asset_simplification2 - reference: Find the original text from the simplification + name: simplification-to-verbose + reference: Make the simplified text more verbose + 41d32553-433c-44fb-9eda-0fce51bf9e14: !Template + answer_choices: A ||| B + id: 41d32553-433c-44fb-9eda-0fce51bf9e14 + jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% + if text|length < original|length %}{{real_simplifications.append(text) | default("", + True)}}{% endif %}{% endfor %} + + {% if real_simplifications %} + + {% set rand_num = range(0,2) | choice %} + + One of the following two sentences is more verbose than the other. Which one + is it? + + {% if rand_num %} + + A: {{real_simplifications | choice}} + + + B: {{original}} + + {% else %} + + A: {{original}} + + + B: {{real_simplifications | choice}} + + {% endif %} + + ||| + + {{ answer_choices[rand_num] }} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: false + name: choose-verbose + reference: '' + 5c2f56b9-5bd4-4455-9d68-0729bfdb9c84: !Template + answer_choices: A ||| B + id: 5c2f56b9-5bd4-4455-9d68-0729bfdb9c84 + jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% + if text|length < original|length %}{{real_simplifications.append(text) | default("", + True)}}{% endif %}{% endfor %} + + {% if real_simplifications %} + + {% set rand_num = range(0,2) | choice %} + + One of the following two sentences is more verbose than the other. Which one + is it? + + {% if rand_num %} + + A: {{real_simplifications | choice}} + + + B: {{original}} + + {% else %} + + A: {{original}} + + + B: {{real_simplifications | choice}} + + {% endif %} + + ||| + + {{ answer_choices[rand_num] }} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: false + name: choose-simplification + reference: '' d528d74b-bbc2-4888-ae21-db0ab37304df: !Template answer_choices: null id: d528d74b-bbc2-4888-ae21-db0ab37304df - jinja: 'I''d like to explain to my child "{{original}}". How would I do so? + jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% + if text|length < original|length %}{{real_simplifications.append(text) | default("", + True)}}{% endif %}{% endfor %} + + {% if real_simplifications %} + + I''d like to explain to my child "{{original}}". How would I do so? ||| - {{simplifications | choice}}' + {{real_simplifications | choice}} + + {% endif %}' metadata: !TemplateMetadata - choices_in_prompt: null - metrics: [] + choices_in_prompt: false + metrics: + - BLEU + - ROUGE original_task: true - name: asset_simplification3 + name: verbose-to-simplification-implicit reference: Implicit simplification request From c7bd04bb9aec3d31de31b72c8b509a7b52f69a6a Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Wed, 29 Dec 2021 16:42:56 +0900 Subject: [PATCH 2/4] Finish asset-simplification --- promptsource/templates/asset/simplification/templates.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promptsource/templates/asset/simplification/templates.yaml b/promptsource/templates/asset/simplification/templates.yaml index 616f44932..6828e0996 100644 --- a/promptsource/templates/asset/simplification/templates.yaml +++ b/promptsource/templates/asset/simplification/templates.yaml @@ -127,7 +127,7 @@ templates: choices_in_prompt: true metrics: - Accuracy - original_task: false + original_task: true name: choose-simplification reference: '' d528d74b-bbc2-4888-ae21-db0ab37304df: !Template From 9f97ff4207d3c31bf9a9a3adf7caddfee701ca1d Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Wed, 29 Dec 2021 16:54:09 +0900 Subject: [PATCH 3/4] Finish asset-simplification --- .../asset/simplification/templates.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/promptsource/templates/asset/simplification/templates.yaml b/promptsource/templates/asset/simplification/templates.yaml index 6828e0996..87aa5428a 100644 --- a/promptsource/templates/asset/simplification/templates.yaml +++ b/promptsource/templates/asset/simplification/templates.yaml @@ -49,13 +49,13 @@ templates: 41d32553-433c-44fb-9eda-0fce51bf9e14: !Template answer_choices: A ||| B id: 41d32553-433c-44fb-9eda-0fce51bf9e14 - jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% - if text|length < original|length %}{{real_simplifications.append(text) | default("", - True)}}{% endif %}{% endfor %} + jinja: '{% set rand_num = range(0,2) | choice %} - {% if real_simplifications %} + {% set real_simplifications = [] %}{% for text in simplifications %}{% if text|length + < original|length %}{{real_simplifications.append(text) | default("", True)}}{% + endif %}{% endfor %} - {% set rand_num = range(0,2) | choice %} + {% if real_simplifications %} One of the following two sentences is more verbose than the other. Which one is it? @@ -91,13 +91,13 @@ templates: 5c2f56b9-5bd4-4455-9d68-0729bfdb9c84: !Template answer_choices: A ||| B id: 5c2f56b9-5bd4-4455-9d68-0729bfdb9c84 - jinja: '{% set real_simplifications = [] %}{% for text in simplifications %}{% - if text|length < original|length %}{{real_simplifications.append(text) | default("", - True)}}{% endif %}{% endfor %} + jinja: '{% set rand_num = range(0,2) | choice %} - {% if real_simplifications %} + {% set real_simplifications = [] %}{% for text in simplifications %}{% if text|length + < original|length %}{{real_simplifications.append(text) | default("", True)}}{% + endif %}{% endfor %} - {% set rand_num = range(0,2) | choice %} + {% if real_simplifications %} One of the following two sentences is more verbose than the other. Which one is it? From a7d212ed63728284a2a3557dc9916e1c9ee56be5 Mon Sep 17 00:00:00 2001 From: Victor Sanh Date: Fri, 7 Jan 2022 20:32:21 +0000 Subject: [PATCH 4/4] fix switch --- promptsource/templates/asset/simplification/templates.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promptsource/templates/asset/simplification/templates.yaml b/promptsource/templates/asset/simplification/templates.yaml index 87aa5428a..91182e838 100644 --- a/promptsource/templates/asset/simplification/templates.yaml +++ b/promptsource/templates/asset/simplification/templates.yaml @@ -99,7 +99,7 @@ templates: {% if real_simplifications %} - One of the following two sentences is more verbose than the other. Which one + One of the following two sentences is more simple than the other. Which one is it? {% if rand_num %} @@ -120,7 +120,7 @@ templates: ||| - {{ answer_choices[rand_num] }} + {{ answer_choices[1-rand_num] }} {% endif %}' metadata: !TemplateMetadata