-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathall_amazon_templates.py
1523 lines (1089 loc) · 34.6 KB
/
all_amazon_templates.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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'''
Pretraining Tasks -- 5 Prompt Families (1, 2, 3, 4, 5)
Zeroshot Tasks -- 1 Prompt Family (Z)
'''
all_tasks = {}
# =====================================================
# Task Subgroup 1 -- Rating -- 10 Prompts
# =====================================================
task_subgroup_1 = {}
template = {}
'''
Input template:
Which star rating will user {{user_id}} give item {{item_id}}? (1 being lowest and 5 being highest)
Target template:
{{star_rating}}
Metrics:
Accuracy
'''
template['source'] = "Which star rating will user_{} give item_{} ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-1"
task_subgroup_1["1-1"] = template
template = {}
'''
Input template:
How will user {{user_id}} rate this product: {{item_title}}? (1 being lowest and 5 being highest)
Target template:
{{star_rating}}
Metrics:
Accuracy
'''
template['source'] = "How will user_{} rate this product : {} ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-2"
task_subgroup_1["1-2"] = template
template = {}
'''
Input template:
Will user {{user_id}} give item {{item_id}} a {{star_rating}}-star rating? (1 being lowest and 5 being highest)
Target template:
{{answer_choices[label]}} (yes/no)
Metrics:
Accuracy
'''
template['source'] = "Will user_{} give item_{} a {}-star rating ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'item_id', 'star_rating']
template['target_argc'] = 1
template['target_argv'] = ['yes_no']
template['id'] = "1-3"
task_subgroup_1["1-3"] = template
template = {}
'''
Input template:
Does user {{user_id}} like or dislike item {{item_id}}?
Target template:
{{answer_choices[label]}} (like/dislike) – like (4,5) / dislike (1,2,3)
Metrics:
Accuracy
'''
template['source'] = "Does user_{} like or dislike item_{} ?"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['like_dislike']
template['id'] = "1-4"
task_subgroup_1["1-4"] = template
template = {}
'''
Input template:
Predict the user {{user_id}}'s preference on item {{item_id}} ({{item_title}})
-1
-2
-3
-4
-5
Target template:
{{answer_choices[star_rating-1]}}
Metrics:
Accuracy
'''
template['source'] = "Predict the user_{} 's preference on item_{} ( {} ) \n -1 \n -2 \n -3 \n -4 \n -5"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'item_id', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-5"
task_subgroup_1["1-5"] = template
template = {}
'''
Input template:
What star rating do you think {{user_desc}} will give item {{item_id}}? (1 being lowest and 5 being highest)
Target template:
{{star_rating}}
Metrics:
Accuracy
'''
template['source'] = "What star rating do you think {} will give item_{} ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-6"
task_subgroup_1["1-6"] = template
template = {}
'''
Input template:
How will {{user_desc}} rate this product: {{item_title}}? (1 being lowest and 5 being highest)
Target template:
{{star_rating}}
Metrics:
Accuracy
'''
template['source'] = "How will {} rate this product : {} ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-7"
task_subgroup_1["1-7"] = template
template = {}
'''
Input template:
Will {{user_desc}} give a {{star_rating}}-star rating for {{item_title}}? (1 being lowest and 5 being highest)
Target template:
{{answer_choices[label]}} (yes/no)
Metrics:
Accuracy
'''
template['source'] = "Will {} give a {}-star rating for {} ? ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 3
template['source_argv'] = ['user_desc', 'star_rating', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['yes_no']
template['id'] = "1-8"
task_subgroup_1["1-8"] = template
template = {}
'''
Input template:
Does {{user_desc}} like or dislike {{item_title}}?
Target template:
{{answer_choices[label]}} (like/dislike) – like (4,5) / dislike (1,2,3)
Metrics:
Accuracy
'''
template['source'] = "Does {} like or dislike {} ?"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['like_dislike']
template['id'] = "1-9"
task_subgroup_1["1-9"] = template
template = {}
'''
Input template:
Predict {{user_desc}}'s preference towards {{item_title}} (1 being lowest and 5 being highest)
Target template:
{{answer_choices[star_rating-1]}}
Metrics:
Accuracy
'''
template['source'] = "Predict {} 's preference towards {} ( 1 being lowest and 5 being highest )"
template['target'] = "{}"
template['task'] = "rating"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['star_rating']
template['id'] = "1-10"
task_subgroup_1["1-10"] = template
all_tasks['rating'] = task_subgroup_1
# =====================================================
# Task Subgroup 2 -- Sequential -- 13 Prompts
# =====================================================
task_subgroup_2 = {}
template = {}
'''
Input template:
Given the following purchase history of user {{user_id}}:
{{history item list of {{item_id}}}}
predict next possible item to be purchased by the user?
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Given the following purchase history of user_{} : \n {} \n predict next possible item to be purchased by the user ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-1"
task_subgroup_2["2-1"] = template
template = {}
'''
Input template:
I find the purchase history list of user {{user_id}}:
{{history item list of {{item_id}}}}
I wonder which is the next item to recommend to the user. Can you help me decide?
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "I find the purchase history list of user_{} : \n {} \n I wonder what is the next item to recommend to the user . Can you help me decide ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-2"
task_subgroup_2["2-2"] = template
template = {}
'''
Input template:
Here is the purchase history list of user {{user_id}}:
{{history item list of {{item_id}}}}
try to recommend next item to the user
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Here is the purchase history list of user_{} : \n {} \n try to recommend next item to the user"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-3"
task_subgroup_2["2-3"] = template
template = {}
'''
Input template:
Given the following purchase history of {{user_desc}}:
{{history item list of {{item_id}}}}
predict next possible item for the user
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Given the following purchase history of {} : \n {} \n predict next possible item for the user"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-4"
task_subgroup_2["2-4"] = template
template = {}
'''
Input template:
Based on the purchase history of {{user_desc}}:
{{history item list of {{item_id}}}}
Can you decide the next item likely to be purchased by the user?
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Based on the purchase history of {} : \n {} \n Can you decide the next item likely to be purchased by the user ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-5"
task_subgroup_2["2-5"] = template
template = {}
'''
Input template:
Here is the purchase history of {{user_desc}}:
{{history item list of {{item_id}}}}
What to recommend next for the user?
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Here is the purchase history of {} : \n {} \n What to recommend next for the user ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-6"
task_subgroup_2["2-6"] = template
# Extractive QA
template = {}
'''
Input template:
Here is the purchase history of user {{user_id}}:
{{history item list of {{item_id}}}}
Select the next possible item likely to be purchased by the user from the following candidates:
{{candidate {{item_id}}}}
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Here is the purchase history of user_{} : \n {} \n Select the next possible item likely to be purchased by the user from the following candidates : \n {}"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'purchase_history', 'candidates']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-7"
task_subgroup_2["2-7"] = template
template = {}
'''
Input template:
Given the following purchase history of {{user_desc}}:
{{history item list of {{item_id}}}}
What to recommend next for the user? Select one from the following items:
{{candidate {{item_id}}}}
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Given the following purchase history of {} : \n {} \n What to recommend next for the user? Select one from the following items : \n {}"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_desc', 'purchase_history', 'candidates']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-8"
task_subgroup_2["2-8"] = template
template = {}
'''
Input template:
Based on the purchase history of user {{user_id}}:
{{history item list of {{item_id}}}}
Choose the next possible purchased item from the following candidates:
{{candidate {{item_id}}}}
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "Based on the purchase history of user_{} : \n {} \n Choose the next possible purchased item from the following candidates : \n {}"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'purchase_history', 'candidates']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-9"
task_subgroup_2["2-9"] = template
template = {}
'''
Input template:
I find the purchase history list of {{user_desc}}:
{{history item list of {{item_id}}}}
I wonder which is the next item to recommend to the user. Try to select one from the following candidates:
{{candidate {{item_id}}}}
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "I find the purchase history list of {} : \n {} \n I wonder which is the next item to recommend to the user . Try to select one from the following candidates : \n {}"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_desc', 'purchase_history', 'candidates']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-10"
task_subgroup_2["2-10"] = template
# Pairwise Prediction
template = {}
'''
Input template:
User {{user_id}} has the following purchase history:
{{history item list of {{item_id}}}}
Does the user likely to buy {{item [item_id]}} next?
Target template:
{{answer_choices[label]}} (yes/no)
Metrics:
Accuracy
'''
template['source'] = "user_{} has the following purchase history : \n {} \n does the user likely to buy {} next ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'purchase_history', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['yes_no']
template['id'] = "2-11"
task_subgroup_2["2-11"] = template
template = {}
'''
Input template:
According to {{user_desc}}'s purchase history list:
{{history item list of {{item_id}}}}
Predict whether the user will purchase {{item [item_id]}} next?
Target template:
{{answer_choices[label]}} (yes/no)
Metrics:
Accuracy
'''
template['source'] = "According to {} 's purchase history list : \n {} \n Predict whether the user will purchase {} next ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 3
template['source_argv'] = ['user_desc', 'purchase_history', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['yes_no']
template['id'] = "2-12"
task_subgroup_2["2-12"] = template
template = {}
'''
Input template:
According to the purchase history of {{user_desc}}:
{{history item list of {{item_id}}}}
Can you recommend the next possible item to the user?
Target template:
{{item [item_id]}}
Metrics:
HR, NDCG, MRR
'''
template['source'] = "According to the purchase history of {} : \n {} \n Can you recommend the next possible item to the user ?"
template['target'] = "{}"
template['task'] = "sequential"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'purchase_history']
template['target_argc'] = 1
template['target_argv'] = ['item_id']
template['id'] = "2-13"
task_subgroup_2["2-13"] = template
all_tasks['sequential'] = task_subgroup_2
# ====================================================
# Task Subgroup 3 -- Explanation -- 12 Prompts
# ====================================================
task_subgroup_3 = {}
template = {}
'''
Input template:
Generate an explanation for user {{user_id}} about this product: {{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Generate an explanation for user_{} about this product : {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-1"
task_subgroup_3["3-1"] = template
template = {}
'''
Input template:
Given the following review headline
{{review_headline}}
can you help generate an explanation of user {{user_id}} for item {{item_id}}?
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Given the following review headline \n {} \n can you help generate an explanation of user_{} for item_{} ?"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['review_headline', 'user_id', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-2"
task_subgroup_3["3-2"] = template
template = {}
'''
Input template:
Help user {{user_id}} generate a {{star_rating}}-star explanation about this product:
{{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Help user_{} generate a {}-star explanation about this product : \n {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['user_id', 'star_rating', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-3"
task_subgroup_3["3-3"] = template
template = {}
'''
Input template:
Generate an explanation for {{user_desc}} about this product: {{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Generate an explanation for {} about this product : {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-4"
task_subgroup_3["3-4"] = template
template = {}
'''
Input template:
Based on the following review headline:
{{review_headline}}
Generate {{user_desc}}'s purchase explanation about {{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Based on the following review headline : \n {} \n Generate {} 's purchase explanation about {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['review_headline', 'user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-5"
task_subgroup_3["3-5"] = template
template = {}
'''
Input template:
Help {{user_desc}} generate a {{star_rating}}-star explanation for item {{item_id}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Help {} generate a {}-star explanation for item_{}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['user_desc', 'star_rating', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-6"
task_subgroup_3["3-6"] = template
template = {}
'''
Input template:
Predict the star rating, then use {{feature}} as feature word to generate user {{user_id}} 's purchase explanation for item {{item_id}}
Target template:
{{star_rating}}, {{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Predict the star rating , then use {} as feature word to generate user_{} 's purchase explanation for item_{}"
template['target'] = "{} , {}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['feature', 'user_id', 'item_id']
template['target_argc'] = 2
template['target_argv'] = ['star_rating', 'explanation']
template['id'] = "3-7"
task_subgroup_3["3-7"] = template
template = {}
'''
Input template:
What score will {{user_desc}} rate item {{item_id}}? Then give an explanation for the rating score. (1 being lowest and 5 being highest)
Target template:
{{star_rating}}, {{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "What score will {} rate item_{} ? Then give an explanation for the rating score . ( 1 being lowest and 5 being highest )"
template['target'] = "{} , {}"
template['task'] = "explanation"
template['source_argc'] = 2
template['source_argv'] = ['user_desc', 'item_id']
template['target_argc'] = 2
template['target_argv'] = ['star_rating', 'explanation']
template['id'] = "3-8"
task_subgroup_3["3-8"] = template
template = {}
'''
Name:
Input template:
Based on the feature word {{feature}}, generate an explanation for user {{user_id}} about this product: {{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Based on the feature word {} , generate an explanation for user_{} about this product : {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['feature', 'user_id', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-9"
task_subgroup_3["3-9"] = template
template = {}
'''
Input template:
Given the word {{feature}}, can you help generate an explanation for {{user_desc}} about the product: \n {{item_title}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Given the word {} , can you help generate an explanation for {} about the product : \n {}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 3
template['source_argv'] = ['feature', 'user_desc', 'item_title']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-10"
task_subgroup_3["3-10"] = template
template = {}
'''
Name:
Input template:
Using the word {{feature}}, write a {{star_rating}}-star explanation for user {{user_id}} about item {{item_id}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Using the word {} , write a {}-star explanation for user_{} about item_{}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 4
template['source_argv'] = ['feature', 'star_rating', 'user_id', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-11"
task_subgroup_3["3-11"] = template
template = {}
'''
Name:
Input template:
According to the feature word {{feature}}, generate a {{star_rating}}-star explanation for {{user_desc}} about item {{item_id}}
Target template:
{{explanation}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "According to the feature word {} , generate a {}-star explanation for {} about item_{}"
template['target'] = "{}"
template['task'] = "explanation"
template['source_argc'] = 4
template['source_argv'] = ['feature', 'star_rating', 'user_desc', 'item_id']
template['target_argc'] = 1
template['target_argv'] = ['explanation']
template['id'] = "3-12"
task_subgroup_3["3-12"] = template
all_tasks['explanation'] = task_subgroup_3
# ====================================================
# Task Subgroup 4 -- Review -- 4 Prompts
# ====================================================
task_subgroup_4 = {}
template = {}
'''
Input template:
Write a short sentence to summarize the following product review from user {{user_id}}:
{{review_body}}
Target template:
{{review_headline}}
Metrics:
BLUE, ROUGE
'''
template['source'] = "Write a short sentence to summarize the following product review from user_{} : \n {}"
template['target'] = "{}"
template['task'] = "review"
template['source_argc'] = 2
template['source_argv'] = ['user_id', 'review_body']
template['target_argc'] = 1
template['target_argv'] = ['review_headline']
template['id'] = "4-1"
task_subgroup_4["4-1"] = template
template = {}
'''
Input template:
Given the following review written by user {{user_id}}:
{{review_body}}
Can you predict the associated star rating (1 being lowest and 5 being highest)?