-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompts.py
169 lines (65 loc) · 9.39 KB
/
prompts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
counterspeech_prompt = """Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior.
A good counterspeech to this hate speech - "{hate_speech}" is: """
# counterspeech_prompt = """Write a good counterspeech to this hate speech - "{hate_speech}" is: """
counterspeech_prompt_llama_two = """[INST] <<SYS>> You are an helpful agent who generates a specific type of counterspeech to the hate speech provided by the user.
Definition: Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. <</SYS>>
{hate_speech} [/INST]"""
counterspeech_prompt_llama_three = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are an helpful agent who generates a specific type of counterspeech to the hate speech provided by the user.
Definition: Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior.
<|eot_id|><|start_header_id|>user<|end_header_id|>{hate_speech}<|eot_id|><|start_header_id|>assistant<|end_header_id|>"""
type_specific_generation_prompt = """Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
A "{type}" type good counterspeech to this hate speech - {hate_speech} is: """
type_specific_generation_prompt_llama_two = """[INST] <<<SYS>> You are an helpful agent who generates a counterspeech of type - {type} to the hate speech provided by the user.
Definition: Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
<</SYS>>
{hate_speech} [/INST] """
type_specific_generation_prompt_llama_three = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are an helpful agent who generates a counterspeech of type - {type} to the hate speech provided by the user.
Definition: Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
<|eot_id|><|start_header_id|>user<|end_header_id|> {hate_speech} <|eot_id|><|start_header_id|>assistant<|end_header_id|>"""
############################ These are classification prompts
type_specific_classification_prompt = """Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
Given this hate speech - "{hate_speech}" and counterspeech - "{counter_speech}" what are the types present in the counterspeech out of the ones listed ? Give in the format of a list """
type_specific_classification_prompt_wo_hs = """Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
Given this counterspeech - "{counter_speech}" what are the types present in the counterspeech out of the ones listed ? Give in the format of a list"""
type_specific_classification_prompt_wo_hs_fewshot = """Counterspeech is a strategic response to hate speech, aiming to foster understanding or discourage harmful behavior. Different types of counterspeech include:
1. contradiction: Point out any inconsistencies or contradictions in the hate speech. Explain and rationalize past behavior or encourage the individual to reflect on their statements.
2. empathy affiliation: Respond with a friendly, empathetic, or peaceful tone to counteract hostility or violence in the original message.
3. humour: Utilize humor, ranging from conciliatory to provocative, through forms like caricature and sarcasm to address the hate speech.
4. questions: Pose thoughtful questions to challenge the hate speaker's sources of information or encourage self-reflection.
5. shaming: Leverage societal stigma associated with offensive terms to prompt speakers to reconsider their statements. Provide insight into the reasons behind the hateful nature of the speech.
6. warning of consequences: Emphasize the potential harm caused by hate speech, highlighting its ability to incite real-world actions. Stress the visibility of online content to the speaker's offline network.
Task is to classify the type of counterspeech given the counterspeech. Some examples are
{examples}
Given this counterspeech - "{counter_speech}" what are the types present in the counterspeech out of the ones listed ? Give in the format of a list"""