-
Notifications
You must be signed in to change notification settings - Fork 22
/
instructions.py
449 lines (410 loc) · 27.9 KB
/
instructions.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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
class InstructionsHandler:
def __init__(self):
self.ate = {}
self.atsc = {}
self.aspe = {}
self.aooe = {}
self.aope = {}
self.aoste = {}
def load_instruction_set1(self, ):
################################# ATE #################################
self.ate['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) which have an associated opinion that are extracted from the input text. In cases where there are no aspects the output should be noaspectterm.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!.
output: features, iChat, Photobooth, garage band
Now complete the following example-
input: """
self.ate['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) which have an associated opinion that are extracted from the input text. In cases where there are no aspects the output should be noaspectterm.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored.
output: menu
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting.
output: food, menu, service, setting
Now complete the following example-
input: """
self.ate['delim_instruct'] = ''
self.ate['eos_instruct'] = ' \noutput:'
################################# ATSC #################################
self.atsc['bos_instruct1'] = """Definition: The output will be 'positive' if the aspect identified in the sentence contains a positive sentiment. If the sentiment of the identified aspect in the input is negative the answer will be 'negative'.
Otherwise, the output should be 'neutral'. For aspects which are classified as noaspectterm, the sentiment is none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life. The aspect is battery life.
output: positive
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!. The aspect is garage band.
output: positive
Now complete the following example-
input: """
self.atsc['bos_instruct2'] = """Definition: The output will be 'positive' if the aspect identified in the sentence contains a positive sentiment. If the sentiment of the identified aspect in the input is negative the answer will be 'negative'.
Otherwise, the output should be 'neutral'. For aspects which are classified as noaspectterm, the sentiment is none.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored. The aspect is menu.
output: positive
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting. The aspect is food.
output: positive
Now complete the following example-
input: """
self.atsc['delim_instruct'] = ' The aspect is '
self.atsc['eos_instruct'] = '.\noutput:'
################################# ASPE #################################
self.aspe['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:positive,
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!.
output: features:positive, iChat:positive, Photobooth:positive, garage band:positive
Now complete the following example-
input: """
self.aspe['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored.
output: menu:positive
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting.
output: food:positive, menu:positive, service:positive, setting:positive
Now complete the following example-
input: """
self.aspe['delim_instruct'] = ''
self.aspe['eos_instruct'] = ' \noutput:'
################################# AOOE #################################
self.aooe['bos_instruct1'] = """Definition: The output will be the opinion/describing word of the aspect terms in the sentence. In cases where there are no aspects the output should be none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life . The aspect is battery life.
output: good
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous. The aspect is GUI.
output: killer
Now complete the following example-
input: """
self.aooe['bos_instruct2'] = """Definition: The output will be the opinion/describing word for the aspect term in the sentence. In cases where there are no aspects the output should be none.
Positive example 1-
input: Faan 's got a great concept but a little rough on the delivery . The aspect term is delivery.
output: rough
Positive example 2-
input: At the end you 're left with a mild broth with noodles that you can slurp out of a cup . The aspect term is broth with noodles.
output: mild
Now complete the following example-
input: """
self.aooe['delim_instruct'] = ' The aspect is '
self.aooe['eos_instruct'] = '.\noutput:'
################################# AOPE #################################
self.aope['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) and the corresponding opinion/describing terms. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:good
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous.
output: quality:high, GUI:killer, applications:good, use:easy
Now complete the following example-
input: """
self.aope['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: Faan 's got a great concept but a little rough on the delivery .
output: delivery:rough
Positive example 2-
input: I just wonder how you can have such a delicious meal for such little money .
output: meal:delicious, money:little
Now complete the following example-
input: """
self.aope['delim_instruct'] = ''
self.aope['eos_instruct'] = ' \noutput:'
################################# AOSTE #################################
self.aoste['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) the corresponding opinion/describing terms and the sentiment polarity (positive, negative, neutral) of the opinion term . In cases where there are no aspects the output should be noaspectterm:none:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:good:positive
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous.
output: quality:high:positive, GUI:killer:positive, applications:good:positive, use:easy:positive
Now complete the following example-
input: """
self.aoste['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) the corresponding opinion/describing terms and the sentiment polarity (positive, negative, neutral) of the opinion term . In cases where there are no aspects the output should be noaspectterm:none:none.
Positive example 1-
input: Faan 's got a great concept but a little rough on the delivery .
output: delivery:rough:positive
Positive example 2-
input: I just wonder how you can have such a delicious meal for such little money .
output: meal:delicious:positive, money:little:positive
Now complete the following example-
input: """
self.aoste['delim_instruct'] = ''
self.aoste['eos_instruct'] = ' \noutput:'
def load_instruction_set2(self, ):
################################# ATE #################################
self.ate['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) which have an associated opinion that are extracted from the input text. In cases where there are no aspects the output should be noaspectterm.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!.
output: features, iChat, Photobooth, garage band
Negative example 1-
input: Speaking of the browser, it too has problems.
output: browser
Negative example 2-
input: The keyboard is too slick.
output: keyboard
Neutral example 1-
input: I took it back for an Asus and same thing- blue screen which required me to remove the battery to reset.
output: battery
Neutral example 2-
input: Nightly my computer defrags itself and runs a virus scan.
output: virus scan
Now complete the following example-
input: """
self.ate['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) which have an associated opinion that are extracted from the input text. In cases where there are no aspects the output should be noaspectterm.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored.
output: menu
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting.
output: food, menu, service, setting
Negative example 1-
input: They did not have mayonnaise, forgot our toast, left out ingredients (ie cheese in an omelet), below hot temperatures and the bacon was so over cooked it crumbled on the plate when you touched it.
output: toast, mayonnaise, bacon, ingredients, plate
Negative example 2-
input: The seats are uncomfortable if you are sitting against the wall on wooden benches.
output: seats
Neutral example 1-
input: I asked for seltzer with lime, no ice.
output: seltzer with lime
Neutral example 2-
input: They wouldnt even let me finish my glass of wine before offering another.
output: glass of wine
Now complete the following example-
input: """
self.ate['delim_instruct'] = ''
self.ate['eos_instruct'] = ' \noutput:'
################################# ATSC #################################
self.atsc['bos_instruct1'] = """Definition: The output will be 'positive' if the aspect identified in the sentence contains a positive sentiment. If the sentiment of the identified aspect in the input is negative the answer will be 'negative'.
Otherwise, the output should be 'neutral'. For aspects which are classified as noaspectterm, the sentiment is none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life. The aspect is battery life.
output: positive
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!. The aspect is garage band.
output: positive
Negative example 1-
input: Speaking of the browser, it too has problems. The aspect is browser.
output: negative
Negative example 2-
input: The keyboard is too slick. The aspect is keyboard.
output: negative
Neutral example 1-
input: I took it back for an Asus and same thing- blue screen which required me to remove the battery to reset. The aspect is battery.
output: neutral
Neutral example 2-
input: Nightly my computer defrags itself and runs a virus scan. The aspect is virus scan.
output: neutral
Now complete the following example-
input: """
self.atsc['bos_instruct2'] = """Definition: The output will be 'positive' if the aspect identified in the sentence contains a positive sentiment. If the sentiment of the identified aspect in the input is negative the answer will be 'negative'.
Otherwise, the output should be 'neutral'. For aspects which are classified as noaspectterm, the sentiment is none.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored. The aspect is menu.
output: positive
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting. The aspect is food.
output: positive
Negative example 1-
input: They did not have mayonnaise, forgot our toast, left out ingredients (ie cheese in an omelet), below hot temperatures and the bacon was so over cooked it crumbled on the plate when you touched it. The aspect is toast.
output: negative
Negative example 2-
input: The seats are uncomfortable if you are sitting against the wall on wooden benches. The aspect is seats.
output: negative
Neutral example 1-
input: I asked for seltzer with lime, no ice. The aspect is seltzer with lime.
output: neutral
Neutral example 2-
input: They wouldnt even let me finish my glass of wine before offering another. The aspect is glass of wine.
output: neutral
Now complete the following example-
input: """
self.atsc['delim_instruct'] = ' The aspect is '
self.atsc['eos_instruct'] = '.\noutput:'
################################# ASPE #################################
self.aspe['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:positive,
Positive example 2-
input: I even got my teenage son one, because of the features that it offers, like, iChat, Photobooth, garage band and more!.
output: features:positive, iChat:positive, Photobooth:positive, garage band:positive
Negative example 1-
input: Speaking of the browser, it too has problems.
output: browser:negative
Negative example 2-
input: The keyboard is too slick.
output: keyboard:negative
Neutral example 1-
input: I took it back for an Asus and same thing- blue screen which required me to remove the battery to reset.
output: battery:neutral
Neutral example 2-
input: Nightly my computer defrags itself and runs a virus scan.
output: virus scan:neutral
Now complete the following example-
input: """
self.aspe['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: With the great variety on the menu , I eat here often and never get bored.
output: menu:positive
Positive example 2-
input: Great food, good size menu, great service and an unpretensious setting.
output: food:positive, menu:positive, service:positive, setting:positive
Negative example 1-
input: They did not have mayonnaise, forgot our toast, left out ingredients (ie cheese in an omelet), below hot temperatures and the bacon was so over cooked it crumbled on the plate when you touched it.
output: toast:negative, mayonnaise:negative, bacon:negative, ingredients:negative, plate:negative
Negative example 2-
input: The seats are uncomfortable if you are sitting against the wall on wooden benches.
output: seats:negative
Neutral example 1-
input: I asked for seltzer with lime, no ice.
output: seltzer with lime:neutral
Neutral example 2-
input: They wouldnt even let me finish my glass of wine before offering another.
output: glass of wine:neutral
Now complete the following example-
input: """
self.aspe['delim_instruct'] = ''
self.aspe['eos_instruct'] = ' \noutput:'
################################# AOOE #################################
self.aooe['bos_instruct1'] = """Definition: The output will be the opinion/describing word of the aspect terms in the sentence. In cases where there are no aspects the output should be none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life . The aspect is battery life.
output: good
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous. The aspect is GUI.
output: killer
Negative example 1-
input: One night I turned the freaking thing off after using it , the next day I turn it on , no GUI , screen all dark , power light steady , hard drive light steady and not flashing as it usually does . The aspect is GUI.
output: no
Negative example 2-
input: I can barely use any usb devices because they will not stay connected properly . The aspect is usb devices.
output: not stay connected properly
Neutral example 1-
input: However , the multi-touch gestures and large tracking area make having an external mouse unnecessary ( unless you 're gaming ) . The aspect is external mouse.
output: unnecessary
Neutral example 2-
input: I wanted to purchase the extended warranty and they refused , because they knew it was trouble . The aspect is extended warranty.
output: refused
Now complete the following example-
input: """
self.aooe['bos_instruct2'] = """Definition: The output will be the opinion/describing word of the aspect terms in the sentence. In cases where there are no aspects the output should be none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life . The aspect is battery life.
output: good
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous. The aspect is GUI.
output: killer
Negative example 1-
input: The menu is very limited - i think we counted 4 or 5 entrees . The aspect is menu.
output: limited
Negative example 2-
input: The strong scents coming from the left and right of me negatively affected my taste buds . The aspect is scents.
output: strong
Neutral example 1-
input: What came to our table was burned beyond recognition and stringy . The aspect is battery table.
output: burned
Neutral example 2-
input: But , nothing stands out about the cooking . The aspect is cooking.
output: nothing stands out
Now complete the following example-
input: """
self.aooe['delim_instruct'] = ' The aspect is '
self.aooe['eos_instruct'] = '.\noutput:'
################################# AOPE #################################
self.aope['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) and the corresponding opinion/describing terms. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:good
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous.
output: quality:high, GUI:killer, applications:good, use:easy
Negative example 1-
input: A month or so ago , the freaking motherboard just died .
output: motherboard:freaking, motherboard:freaking
Negative example 2-
input: I had always used PCs and been constantly frustrated by the crashing and the poorly designed operating systems that were never very intuitive .
output: operating systems:poorly designed, operating systems:intuitive
Neutral example 1-
input: It has a 10 hour battery life when you 're doing web browsing and word editing , making it perfect for the classroom or office , and in terms of gaming and movie playing it 'll have a battery life of just over 5 hours .
output: web browsing:perfect, word editing:perfect
Neutral example 2-
input: no complaints with their desktop , and maybe because it just sits on your desktop , and you do n't carry it around , which could jar the hard drive , or the motherboard .
output: hard drive:jar, motherboard:jar
Now complete the following example-
input: """
self.aope['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
Positive example 1-
input: Faan 's got a great concept but a little rough on the delivery .
output: delivery:rough
Positive example 2-
input: I just wonder how you can have such a delicious meal for such little money .
output: meal:delicious, money:little
Negative example 1-
input: From the terrible service , to the bland food , not to mention the unaccommodating managers , the overall experience was horrible .
output: service:terrible, food:bland, managers:unaccommodating
Negative example 2-
input: I had the Pad Thai and the noodles were sticky .
output: Pad Thai:sticky, noodles:sticky
Neutral example 1-
input: The Dim Sum was so-so , but not spectacular .
output: Dim Sum:so-so, Dim Sum:not spectacular
Neutral example 2-
input: The location and ambience is Ok but the food is what makes up for it .
output: mlocationeal:Ok, ambience:Ok
Now complete the following example-
input: """
self.aope['delim_instruct'] = ''
self.aope['eos_instruct'] = ' \noutput:'
################################# AOSTE #################################
self.aoste['bos_instruct1'] = """Definition: The output will be the aspects (both implicit and explicit) the corresponding opinion/describing terms and the sentiment polarity (positive, negative, neutral) of the opinion term . In cases where there are no aspects the output should be noaspectterm:none:none.
Positive example 1-
input: I charge it at night and skip taking the cord with me because of the good battery life.
output: battery life:good:positive
Positive example 2-
input: it is of high quality , has a killer GUI , is extremely stable , is highly expandable , is bundled with lots of very good applications , is easy to use , and is absolutely gorgeous.
output: quality:high:positive, GUI:killer:positive, applications:good:positive, use:easy:positive
Negative example 1-
input: A month or so ago , the freaking motherboard just died .
output: motherboard:freaking:negative, motherboard:freaking:negative
Negative example 2-
input: I had always used PCs and been constantly frustrated by the crashing and the poorly designed operating systems that were never very intuitive .
output: operating systems:poorly designed, operating systems:intuitive
Neutral example 1-
input: It has a 10 hour battery life when you 're doing web browsing and word editing , making it perfect for the classroom or office , and in terms of gaming and movie playing it 'll have a battery life of just over 5 hours .
output: web browsing:perfect:neutral, word editing:perfect:neutral
Neutral example 2-
input: no complaints with their desktop , and maybe because it just sits on your desktop , and you do n't carry it around , which could jar the hard drive , or the motherboard .
output: hard drive:jar:neutral, motherboard:jar:neutral
Now complete the following example-
input: """
self.aoste['bos_instruct2'] = """Definition: The output will be the aspects (both implicit and explicit) the corresponding opinion/describing terms and the sentiment polarity (positive, negative, neutral) of the opinion term . In cases where there are no aspects the output should be noaspectterm:none:none.
Positive example 1-
input: Faan 's got a great concept but a little rough on the delivery .
output: delivery:rough:positive
Positive example 2-
input: I just wonder how you can have such a delicious meal for such little money .
output: meal:delicious:positive, money:little:positive
Negative example 1-
input: From the terrible service , to the bland food , not to mention the unaccommodating managers , the overall experience was horrible .
output: service:terrible:negative, food:bland:negative, managers:unaccommodating:negative
Negative example 2-
input: I had the Pad Thai and the noodles were sticky .
output: Pad Thai:sticky:negative, noodles:sticky:negative
Neutral example 1-
input: The Dim Sum was so-so , but not spectacular .
output: Dim Sum:so-so:neutral, Dim Sum:not spectacular:neutral
Neutral example 2-
input: The location and ambience is Ok but the food is what makes up for it .
output: mlocationeal:Ok:neutral, ambience:Ok:neutral
Now complete the following example-
input: """
self.aoste['delim_instruct'] = ''
self.aoste['eos_instruct'] = ' \noutput:'