-
Notifications
You must be signed in to change notification settings - Fork 6
/
prompt.py
683 lines (524 loc) · 17.3 KB
/
prompt.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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
"""
Pretraining Tasks -- 5 Prompt Families (1, 2, 3, 4, 5)
"""
# =====================================================
# Task Subgroup 1 -- Sequential item -- 10 Prompts
# =====================================================
task_subgroup_1 = []
template = {}
template[
"source"
] = "User_{} has purchased {} , predict next possible item to be bought by the user ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-1"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "I find the purchase list of user_{} : {} , I wonder what other itmes does the user need . Can you help me decide ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-2"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "Here is the purchase list of user_{} : {} , try to recommend another item to the user ."
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-3"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "According to what items user_{} has purchased : {} , Can you recommend another item to the user ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-4"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "The user_{} has bought items : {} , What else do you think is necessary for the user ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-5"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "Here is the item purchase history of user_{} : {} , What to recommend next for the user ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-6"
task_subgroup_1.append(template)
template = {}
template["source"] = "What would user_{} be likely to purchase next after buying {} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-7"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "By analyzing the user_{} 's purchase of {}, what is the next item expected to be bought ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-8"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "After buying items {} , what is the next item that could be recommended for user_{} ?"
template["target"] = "{}"
template["input_first"] = ""
template["task"] = "sequential"
template["id"] = "1-9"
task_subgroup_1.append(template)
template = {}
template[
"source"
] = "Can you recommend the next item for user_{} , given the user 's purchase of {} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential"
template["id"] = "1-10"
task_subgroup_1.append(template)
# =====================================================
# Task Subgroup 2 -- Sequential Yes/no -- 8 Prompts
# =====================================================
task_subgroup_2 = []
# Pairwise Prediction
template = {}
template[
"source"
] = "User_{} has bought the following items : {} , does the user likely to buy {} as well ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential_yesno"
template["id"] = "2-1"
task_subgroup_2.append(template)
template = {}
template[
"source"
] = "According to user_{} 's bought item list : {} , Predict whether the user will buy or has already bought {} ."
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential_yesno"
template["id"] = "2-2"
task_subgroup_2.append(template)
template = {}
template[
"source"
] = "According to user_{} 's bought item list : {} , Do you think the user also needs {} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "sequential_yesno"
template["id"] = "2-3"
task_subgroup_2.append(template)
# =====================================================
# Task Subgroup 3 -- Direct -- 5 Prompts
# =====================================================
task_subgroup_3 = []
template = {}
template["source"] = "Will user_{} likely to purchase item_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_yesno"
template["target_argv"] = ["yes_no"]
template["id"] = "3-1"
task_subgroup_3.append(template)
template = {}
template["source"] = "Shall we recommend item_{} to user_{} ?"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "direct_yesno"
template["target_argv"] = ["yes_no"]
template["id"] = "3-2"
task_subgroup_3.append(template)
template = {}
template["source"] = "For user_{}, do you think it is good to recommend item_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_yesno"
template["target_argv"] = ["yes_no"]
template["id"] = "3-3"
task_subgroup_3.append(template)
template = {}
template[
"source"
] = "I would like to recommend some items for user_{} . Is the following item_{} a good choice ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_yesno"
template["target_argv"] = ["yes_no"]
template["id"] = "3-4"
task_subgroup_3.append(template)
template = {}
template["source"] = "Do you think user_{} will like to buy item_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_yesno"
template["target_argv"] = ["yes_no"]
template["id"] = "3-5"
task_subgroup_3.append(template)
# =====================================================
# Task Subgroup 4 -- Direct Candidates -- 5 Prompts
# =====================================================
task_subgroup_4 = []
template = {}
template["source"] = "Which one of the following items to recommend for user_{} ? {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_candidates"
template["target_argv"] = ["groundtruth_item_ids"]
template["id"] = "4-1"
task_subgroup_4.append(template)
template = {}
template[
"source"
] = "Choose the best item from the candidates to recommend for user_{} ? {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_candidates"
template["target_argv"] = ["groundtruth_item_ids"]
template["id"] = "4-2"
task_subgroup_4.append(template)
template = {}
template[
"source"
] = "Pick the most useful item from the following list and recommend to user_{} : {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_candidates"
template["target_argv"] = ["groundtruth_item_ids"]
template["id"] = "4-3"
task_subgroup_4.append(template)
template = {}
template[
"source"
] = "We want to make recommendation for user_{} . Select the best item from these candidates : {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_candidates"
template["target_argv"] = ["groundtruth_item_ids"]
template["id"] = "4-4"
task_subgroup_4.append(template)
template = {}
template[
"source"
] = "Our intention is to select the best item for user_{} from the below candidates : {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_candidates"
template["target_argv"] = ["groundtruth_item_ids"]
template["id"] = "4-5"
task_subgroup_4.append(template)
# ========================================================
# Task Subgroup 5 -- Direct Straightforward -- 5 Prompts
# ========================================================
task_subgroup_5 = []
template = {}
template["source"] = "What should we recommend for user_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_straightforward"
template["id"] = "5-1"
task_subgroup_5.append(template)
template = {}
template["source"] = "Which recommendation should we provide to user_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_straightforward"
template["id"] = "5-2"
task_subgroup_5.append(template)
template = {}
template["source"] = "How can we assist user_{} with a recommendation ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_straightforward"
template["id"] = "5-3"
task_subgroup_5.append(template)
template = {}
template["source"] = "What would be a suitable recommendation for user_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_straightforward"
template["id"] = "5-4"
task_subgroup_5.append(template)
template = {}
template["source"] = "What would be a helpful recommendation for user_{} ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "direct_straightforward"
template["id"] = "5-5"
task_subgroup_5.append(template)
# ========================================================
# Task Subgroup 6 -- Meta Data Title -- 5 Prompts
# ========================================================
task_subgroup_6 = []
template = {}
template["source"] = "Which item has the title {} ?"
template["target"] = "{}"
template["task"] = "title"
template["id"] = "6-1"
task_subgroup_6.append(template)
template = {}
template["source"] = "Which item is given the name of {} ?"
template["target"] = "{}"
template["task"] = "title"
template["id"] = "6-2"
task_subgroup_6.append(template)
template = {}
template["source"] = "An item is called {} . Which item is it ?"
template["target"] = "{}"
template["task"] = "title"
template["id"] = "6-3"
task_subgroup_6.append(template)
template = {}
template["source"] = "Which item is called {} ?"
template["target"] = "{}"
template["task"] = "title"
template["id"] = "6-4"
task_subgroup_6.append(template)
template = {}
template["source"] = "One item goes by the name {} . Can you tell me which item it is ?"
template["target"] = "{}"
template["task"] = "title"
template["id"] = "6-5"
task_subgroup_6.append(template)
# ================================================================================
# Task Subgroup 9 -- Meta Data use description to find item -- 5 Prompts
# ================================================================================
task_subgroup_9 = []
template = {}
template[
"source"
] = "An item can be described as follows: {} . Which item is it describing ?"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-1"
task_subgroup_9.append(template)
template = {}
template["source"] = "Can you tell me which item is described as {} ?"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-2"
task_subgroup_9.append(template)
template = {}
template[
"source"
] = "Can you provide the name of the item that is considered as this ? {} "
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-3"
task_subgroup_9.append(template)
template = {}
template["source"] = "Which item has been described as below ? Description : {} "
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-4"
task_subgroup_9.append(template)
template = {}
template["source"] = "What item fits the below description ? Description : {}"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-5"
task_subgroup_9.append(template)
template = {}
template["source"] = "Which item has the following characteristics ? {}"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-6"
task_subgroup_9.append(template)
template = {}
template[
"source"
] = "Which item possesses the quality of described as follows ? Description : {}"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-7"
task_subgroup_9.append(template)
template = {}
template[
"source"
] = "I am curious to know which item can be described as below: {} . Can you tell me ?"
template["target"] = "{}"
template["task"] = "description"
template["input"] = "description"
template["id"] = "9-8"
task_subgroup_9.append(template)
# ========================================================
# Task Subgroup 8 -- Meta Data Category -- 5 Prompts
# ========================================================
task_subgroup_8 = []
template = {}
template["source"] = "For category {}, which item belongs to it ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-1"
task_subgroup_8.append(template)
template = {}
template["source"] = "Which item pertains to these category labels : {} ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-2"
task_subgroup_8.append(template)
template = {}
template["source"] = "Which item fits into the category or these categories {} ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-3"
task_subgroup_8.append(template)
template = {}
template["source"] = "Which item can be classified into categories {} ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-4"
task_subgroup_8.append(template)
template = {}
template["source"] = "Which item 's classification can be said as such {} ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-5"
task_subgroup_8.append(template)
template = {}
template[
"source"
] = "What item can be said to have these characteristics {} in their nature ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-6"
task_subgroup_8.append(template)
template = {}
template["source"] = "Can you name one item that belongs to these categories {} ?"
template["target"] = "{}"
template["task"] = "category"
template["id"] = "8-7"
task_subgroup_8.append(template)
# ================================================================
# Task Subgroup 10 -- Meta Data Reviews, ask item -- 6 Prompts
# ================================================================
task_subgroup_10 = []
template = {}
template[
"source"
] = "User_{} made a comment for one item as this: {} Can you tell me which item it is ?"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "review"
template["id"] = "10-1"
task_subgroup_10.append(template)
template = {}
template[
"source"
] = "Which item recived the view stated below from user_{} ? Review : {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "review"
template["id"] = "10-2"
task_subgroup_10.append(template)
template = {}
template[
"source"
] = "I am trying to find out which item was described as this : {} , which is presented by user_{} ."
template["target"] = "{}"
template["input_first"] = "review"
template["task"] = "review"
template["id"] = "10-3"
task_subgroup_10.append(template)
template = {}
template[
"source"
] = "Can you identify the item that user_{} has described as below ? {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "review"
template["id"] = "10-4"
task_subgroup_10.append(template)
template = {}
template[
"source"
] = " Can you determine which item user_{} was referring to when they left a comment as below ? Review : {}"
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "review"
template["id"] = "10-5"
task_subgroup_10.append(template)
template = {}
template[
"source"
] = " User_{} has left a comment below : {} I need to know which item it is describing . Can you help me find it ? "
template["target"] = "{}"
template["input_first"] = "user"
template["task"] = "review"
template["id"] = "10-6"
task_subgroup_10.append(template)
# ================================================================
# Task Subgroup 11 -- Meta Data Reviews, ask user -- 6 Prompts
# ================================================================
task_subgroup_11 = []
template = {}
template[
"source"
] = "Item_{} has received a comment as below : {} Can you tell me which user made this comment ?"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-1"
task_subgroup_11.append(template)
template = {}
template["source"] = "Who left the comment below for item_{} ? Review : {}"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-2"
task_subgroup_11.append(template)
template = {}
template[
"source"
] = "Can you tell me who left the below comment for item_{} ? Comment: {}"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-3"
task_subgroup_11.append(template)
template = {}
template["source"] = "Which user had such opinion on item_{} ? Opinion : {}"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-4"
task_subgroup_11.append(template)
template = {}
template["source"] = "Who described item_{} as such ? Description : {}"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-5"
task_subgroup_11.append(template)
template = {}
template[
"source"
] = "I need to know which user made the below comment for item_{} : {} . Can you help me find the user ?"
template["target"] = "{}"
template["input_first"] = "item"
template["task"] = "review"
template["id"] = "11-6"
task_subgroup_11.append(template)