Skip to content

Commit f4060bf

Browse files
authored
Finish rating (#710)
* Finish rating * Set variables outside the if statement
1 parent 29c3dd8 commit f4060bf

File tree

1 file changed

+77
-22
lines changed

1 file changed

+77
-22
lines changed

promptsource/templates/asset/ratings/templates.yaml

Lines changed: 77 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ dataset: asset
22
subset: ratings
33
templates:
44
09b2a13b-cba6-4473-8a46-3fa24be71ce2: !Template
5-
answer_choices: null
5+
answer_choices: No ||| Yes
66
id: 09b2a13b-cba6-4473-8a46-3fa24be71ce2
7-
jinja: "{% set questions= [ \"Does the second sentence better convey the information?\"\
8-
, \"Is the second sentence more fluent?\", \"Is the second sentence easier\
9-
\ to understand?\"] %}\n\nFirst sentence: {{original}}\n\nSecond sentence: {{simplification}}\n\
10-
\n{{questions[aspect]}} \n\n|||\n\n{% if rating > 50 %}\n Yes\n{% else %}\n\
11-
\ No\n{% endif %}"
7+
jinja: "{% set label = None %}\n{% set questions = None %}\n{% if rating > 50\
8+
\ %}\n{% set label = 1 %}\n{% else %}\n{% set label = 0 %}\n{% endif %}\n{%\
9+
\ set questions= [ \"Does the second sentence better convey the information?\"\
10+
, \"Is the second sentence more fluent?\", \"Is the second sentence simpler?\"\
11+
] %}\n\nFirst sentence: {{original}}\n\nSecond sentence: {{simplification}}\n\
12+
\n{{questions[aspect]}}. Please answer Yes or No. \n|||\n{{answer_choices[label]}}\n"
1213
metadata: !TemplateMetadata
13-
choices_in_prompt: null
14-
metrics: []
15-
original_task: false
16-
name: asset_ratings1
14+
choices_in_prompt: true
15+
metrics:
16+
- Accuracy
17+
original_task: true
18+
name: rate-binary
1719
reference: Taking questions from the original paper, we use rating to establish
18-
a binary classification problem.
20+
a binary classification problem
1921
47142040-4121-4144-98b9-61cb5cbb1313: !Template
2022
answer_choices: null
2123
id: 47142040-4121-4144-98b9-61cb5cbb1313
@@ -34,23 +36,76 @@ templates:
3436
3537
{{rating}}'
3638
metadata: !TemplateMetadata
37-
choices_in_prompt: null
38-
metrics: []
39+
choices_in_prompt: false
40+
metrics:
41+
- Other
3942
original_task: true
40-
name: asset_ratings3
43+
name: rate-regression-simplicity
4144
reference: Prompt model to rate how simplified the sentence is in the general
42-
sense, instead of an particular aspect.
45+
sense, instead of an particular aspect. This is a regression task whose range
46+
is from 0 to 100.
47+
7dd6e8b6-eae0-40c5-aa5e-1cc24357d85d: !Template
48+
answer_choices: null
49+
id: 7dd6e8b6-eae0-40c5-aa5e-1cc24357d85d
50+
jinja: '{% set label = None %}
51+
52+
{% set questions = None %}
53+
54+
{% if rating > 50 %}
55+
56+
{% set label = 1 %}
57+
58+
{% else %}
59+
60+
{% set label = 0 %}
61+
62+
{% endif %}
63+
64+
{% if label == 1 %}
65+
66+
{% set questions= [ "Rewrite the following sentence so that it conveys the information
67+
better.", "Rewrite the following sentence so that it is more fluent.", "Rewrite
68+
the following sentence so that it is simpler."] %}
69+
70+
{% else %}
71+
72+
{% set questions= [ "Rewrite the following sentence so that it conveys the information
73+
more poorly.", "Rewrite the following sentence so that it is less fluent.",
74+
"Rewrite the following sentence so that it is more complicated."] %}
75+
76+
{% endif %}
77+
78+
{{questions[aspect]}}
79+
80+
81+
{{original}}
82+
83+
|||
84+
85+
{{simplification}}
86+
87+
'
88+
metadata: !TemplateMetadata
89+
choices_in_prompt: false
90+
metrics:
91+
- BLEU
92+
- ROUGE
93+
original_task: false
94+
name: generate-text-based-on-rating
95+
reference: ''
4396
d2bed959-29ab-4962-a106-dc91c00f3f03: !Template
4497
answer_choices: null
4598
id: d2bed959-29ab-4962-a106-dc91c00f3f03
4699
jinja: "{% set statements= [ \"the second sentence expresses the underlying meaning\
47100
\ the best.\", \"the second sentence is more fluent.\", \"the second sentence\
48-
\ is easier to read and understand.\"] %}\n\nFirst sentence: {{original}}\n\n\
49-
Second sentence: {{simplification}}\n\nRate the following statement from 0 (strongly\
50-
\ disagree) to 100 (strongly agree): {{statements[aspect]}} \n\n|||\n\n{{rating}}"
101+
\ is simpler.\"] %}\n\nFirst sentence: {{original}}\n\nSecond sentence: {{simplification}}\n\
102+
\nRate the following statement from 0 (strongly disagree) to 100 (strongly agree):\
103+
\ {{statements[aspect]}} \n\n|||\n{{rating}}"
51104
metadata: !TemplateMetadata
52-
choices_in_prompt: null
53-
metrics: []
105+
choices_in_prompt: false
106+
metrics:
107+
- Other
54108
original_task: true
55-
name: asset_ratings2
56-
reference: Require the model to output the rating
109+
name: rate-regression
110+
reference: Require the model to output the rating. This is a regression task whose
111+
range is from 0 to 100.

0 commit comments

Comments
 (0)