From b0ccaa6a205333920988c67752c4fe74c85253b4 Mon Sep 17 00:00:00 2001 From: HadarT Date: Mon, 24 Jan 2022 18:13:58 +0200 Subject: [PATCH 1/3] first template for hate_speech dataset --- promptsource/templates/hate_speech18/templates.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 promptsource/templates/hate_speech18/templates.yaml diff --git a/promptsource/templates/hate_speech18/templates.yaml b/promptsource/templates/hate_speech18/templates.yaml new file mode 100644 index 000000000..1798f8ac7 --- /dev/null +++ b/promptsource/templates/hate_speech18/templates.yaml @@ -0,0 +1,13 @@ +dataset: hate_speech18 +hate_speech18_template: ! + answer_choices: noHate | | | hate + id: hate_speech18_template + jinja: '{{text}} Is the sentiment the sentence expresses is a {{answer_choices[1]}} speech + or {{answer_choices[0]}} speech? | | | {{answer_choices[label]}}' + metadata: ! + choices_in_prompt: true + metrics: + - Accuracy + original_task: true + name: hate_or_noHate_sentiment_analysis + reference: '' From aa947105cbf712ba1244a3a0253feb322bb94b21 Mon Sep 17 00:00:00 2001 From: VictorSanh Date: Wed, 26 Jan 2022 20:42:02 +0000 Subject: [PATCH 2/3] fix template + wrap into conditional statement --- .../templates/hate_speech18/templates.yaml | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/promptsource/templates/hate_speech18/templates.yaml b/promptsource/templates/hate_speech18/templates.yaml index 1798f8ac7..d2b24bbe3 100644 --- a/promptsource/templates/hate_speech18/templates.yaml +++ b/promptsource/templates/hate_speech18/templates.yaml @@ -1,13 +1,18 @@ dataset: hate_speech18 -hate_speech18_template: ! - answer_choices: noHate | | | hate - id: hate_speech18_template - jinja: '{{text}} Is the sentiment the sentence expresses is a {{answer_choices[1]}} speech - or {{answer_choices[0]}} speech? | | | {{answer_choices[label]}}' - metadata: ! - choices_in_prompt: true - metrics: - - Accuracy - original_task: true +templates: + 3266f9d4-9c80-4e17-a8a6-1fe44ca8f3bf: !Template + answer_choices: noHate ||| hate + id: 3266f9d4-9c80-4e17-a8a6-1fe44ca8f3bf + jinja: '{% if label in [0, 1] %} + + {{text}} Is the sentiment the sentence expresses is a {{answer_choices[1]}} speech + or {{answer_choices[0]}} speech? ||| {{answer_choices[label]}} + + {% endif %}' + metadata: !TemplateMetadata + choices_in_prompt: true + metrics: + - Accuracy + original_task: true name: hate_or_noHate_sentiment_analysis - reference: '' + reference: '' \ No newline at end of file From 43a965af373779132d16fb14eebc4de7b2824fcd Mon Sep 17 00:00:00 2001 From: Victor SANH Date: Thu, 27 Jan 2022 22:04:16 -0500 Subject: [PATCH 3/3] Update promptsource/templates/hate_speech18/templates.yaml --- promptsource/templates/hate_speech18/templates.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promptsource/templates/hate_speech18/templates.yaml b/promptsource/templates/hate_speech18/templates.yaml index d2b24bbe3..71b1a59c5 100644 --- a/promptsource/templates/hate_speech18/templates.yaml +++ b/promptsource/templates/hate_speech18/templates.yaml @@ -15,4 +15,4 @@ templates: - Accuracy original_task: true name: hate_or_noHate_sentiment_analysis - reference: '' \ No newline at end of file + reference: ''