File size: 6,183 Bytes
6dc4993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
GEC = [
    "Fix grammar",
    "Fix grammar in this sentence",
    "Fix grammar in the sentence",
    "Fix grammar errors",
    "Fix grammatical errors",
    "Fix grammaticality",
    "Fix all grammatical errors",
    "Fix grammatical errors in this sentence",
    "Fix grammar errors in this sentence",
    "Fix grammatical mistakes in this sentence",
    "Fix grammaticality in this sentence",
    "Fix grammaticality of the sentence",
    "Fix disfluencies in the sentence",
    "Make the sentence grammatical",
    "Make the sentence fluent",
    "Fix errors in this text",
    "Update to remove grammar errors",
    "Remove all grammatical errors from this text",
    "Improve the grammar of this text",
    "Improve the grammaticality",
    "Improve the grammaticality of this text",
    "Improve the grammaticality of this sentence",
    "Grammar improvements",
    "Remove grammar mistakes",
    "Remove grammatical mistakes",
    "Fix the grammar mistakes",
    "Fix grammatical mistakes Clarity Clarify the sentence",
    ]
Clarify = [
    "Clarify this sentence",
    "Clarify this text",
    "Write a clearer version for the sentence",
    "Write a clarified version of the sentence",
    "Write a readable version of the sentence",
    "Write a better readable version of the sentence",
    "Rewrite the sentence more clearly",
    "Rewrite this sentence clearly",
    "Rewrite this sentence for clarity",
    "Rewrite this sentence for readability",
    "Improve this sentence for readability",
    "Make this sentence better readable",
    "Make this sentence more readable",
    "Make this sentence readable",
    "Make the sentence clear",
    "Make the sentence clearer",
    "Clarify",
    "Make the text more understandable",
    "Make this easier to read",
    "Clarification",
    "Change to clearer wording",
    "Clarify this paragraph",
    "Use clearer wording Simplification Simplify the sentence",
    "Simplify this sentence",
    "Simplify this text",
    "Write a simpler version for the sentence",
    "Rewrite the sentence to be simpler",
    "Rewrite this sentence in a simpler manner",
    "Rewrite this sentence for simplicity",
    "Rewrite this with simpler wording",
    "Make the sentence simple",
    "Make the sentence simpler",
    "Make this text less complex",
    "Make this simpler",
    "Simplify",
    "Simplification",
    "Change to simpler wording",
    "Simplify this paragraph",
    "Simplify this text",
    "Use simpler wording",
    "Make this easier to understand"
    ]
Coherence = [
    "Fix coherence",
    "Fix coherence in this sentence",
    "Fix coherence in the sentence",
    "Fix coherence in this text",
    "Fix coherence in the text",
    "Fix coherence errors",
    "Fix sentence flow",
    "Fix sentence transition",
    "Fix coherence errors in this sentence",
    "Fix coherence mistakes in this sentence",
    "Fix coherence in this sentence",
    "Fix coherence of the sentence",
    "Fix lack of coherence in the sentence",
    "Make the text more coherent",
    "Make the text coherent",
    "Make the text more cohesive",
    "logically linked and consistent as a whole",
    "Make the text more cohesive",
    "Improve the cohesiveness of the text",
    "Make the text more logical",
    "Make the text more consistent",
    "Improve the consistency of the text",
    "Make the text clearer",
    "Improve the coherence of the text"
    ]
Formality_Style_Transfer = [
    "Formalize",
    "Improve formality",
    "Formalize the sentence",
    "Formalize this sentence",
    "Formalize the text",
    "Formalize this text",
    "Make this formal",
    "Make this more formal",
    "Make this sound more formal",
    "Make the sentence formal",
    "Make the sentence more formal",
    "Make the sentence sound more formal",
    "Write more formally",
    "Write less informally",
    "Rewrite more formally",
    "Write this more formally",
    "Rewrite this more formally",
    "Write in a formal manner",
    "Write in a more formal manner",
    "Rewrite in a more formal manner"
    ]
Neutralization = [
    "Remove POV",
    "Remove POVs",
    "Remove POV in this text",
    "Remove POVs in this text",
    "Neutralize this text",
    "Neutralize the text",
    "Neutralize this sentence",
    "Neutralize the sentence",
    "Make this more neutral",
    "Make this text more neutral",
    "Make this sentence more neutral",
    "Make this paragraph more neutral",
    "Remove unsourced opinions",
    "Remove unsourced opinions from this text",
    "Remove non-neutral POVs",
    "Remove non-neutral POV",
    "Remove non-neutral points of view",
    "Remove points of view",
    "Make this text less biased Paraphrasing Paraphrase the sentence",
    "Paraphrase this sentence",
    "Paraphrase this text",
    ]
Paraphrase = [
    "Write a paraphrase for the sentence",
    "Write a paraphrased version of the sentence",
    "Rewrite the sentence with different wording",
    "Use different wording",
    "Rewrite this sentence",
    "Reword this sentence",
    "Rephrase this sentence",
    "Rewrite this text",
    "Reword this text",
    "Rephrase this text"
    ]


import random
import os

instruction_prompts = {
    "Grammar Error Correction": GEC,
    "Clarify": Clarify,
    "Coherence": Coherence,
    "Formality Style Transfer": Formality_Style_Transfer,
    "Neutralization": Neutralization,
    "Paraphrase": Paraphrase,
}

def get_prompt_list(instruction_type: str) -> list:
    """
    Returns a list of prompts for the given instruction type.

    Args:
        instruction_type: The type of instruction, e.g., "Grammar Error Correction".

    Returns:
        A list of prompts corresponding to the instruction type.
    """
    return instruction_prompts[instruction_type]

def get_random_prompt(instruction_type: str) -> str:
    """
    Returns a random prompt from the list of prompts for the given instruction type.

    Args:
        instruction_type: The type of instruction, e.g., "Grammar Error Correction".

    Returns:
        A random prompt from the list of prompts for the instruction type.
    """
    return random.choice(instruction_prompts[instruction_type])