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 
 
1
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # TODO: Address all TODOs and remove all explanatory comments
15
+ """TODO: Add a description here."""
16
+
17
+ import textwrap
18
+ import csv
19
+ import pandas as pd
20
+ import json
21
+ import os
22
+
23
+ import datasets
24
+
25
+ _VERSION = datasets.Version("1.1.0")
26
+
27
+ # TODO: Add BibTeX citation
28
+ # Find for instance the citation on arxiv or on the dataset repo/website
29
+ _DAISO_CITATION = """\
30
+ @InProceedings{huggingface:dataset,
31
+ title = {A great new dataset},
32
+ author={Unknown, Unknown},
33
+ year={2023}
34
+ }
35
+ """
36
+
37
+ # TODO: Add description of the dataset here
38
+ # You can copy an official description
39
+ _DAISO_DESCRIPTION = """\
40
+ This new dataset is designed to solve this great NLP task and is crafted with a lot of care.
41
+ """
42
+
43
+ # TODO: Add a link to an official homepage for the dataset here
44
+ _HOMEPAGE = ""
45
+
46
+ # TODO: Add the licence for the dataset here if you can find it
47
+ _LICENSE = ""
48
+
49
+ # TODO: Add link to the official dataset URLs here
50
+ # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
51
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
52
+ _URL = "https://anonymous.4open.science/r/Datasets"
53
+
54
+ LABELS_MAPPING = {
55
+ "ami": {
56
+ "bck": {
57
+ "base": "Backchannel",
58
+ "ISO": "feedback"
59
+ },
60
+ "stl": {
61
+ "base": "Stall",
62
+ "ISO": "OOD"
63
+ },
64
+ "fra": {
65
+ "base": "Fragment",
66
+ "ISO": "OOD"
67
+ },
68
+ "inf": {
69
+ "base": "Inform",
70
+ "ISO": "inform"
71
+ },
72
+ "sug": {
73
+ "base": "Suggest",
74
+ "ISO": "directive"
75
+ },
76
+ "ass": {
77
+ "base": "Assess",
78
+ "ISO": "feedback"
79
+ },
80
+ "el.inf": {
81
+ "base": "Elicit-Inform",
82
+ "ISO": "OOD"
83
+ },
84
+ "el.sug": {
85
+ "base": "Elicit-Offer-Or-Suggestion",
86
+ "ISO": "directive"
87
+ },
88
+ "el.ass": {
89
+ "base": "Elicit-Assessment",
90
+ "ISO": "OOD"
91
+ },
92
+ "el.und": {
93
+ "base": "Elicit-Comment-Understanding",
94
+ "ISO": "OOD"
95
+ },
96
+ "off": {
97
+ "base": "Offer",
98
+ "ISO": "commissive"
99
+ },
100
+ "und": {
101
+ "base": "Comment-About-Understanding",
102
+ "ISO": "feedback"
103
+ },
104
+ "be.pos": {
105
+ "base": "Be-Positive",
106
+ "ISO": "OOD"
107
+ },
108
+ "be.neg": {
109
+ "base": "Be-Negative",
110
+ "ISO": "OOD"
111
+ },
112
+ "oth": {
113
+ "base": "Other",
114
+ "ISO": "OOD"
115
+ },
116
+ None: {
117
+ "base": "OOD",
118
+ "ISO": "OOD"
119
+ }
120
+ },
121
+ "oasis": {
122
+ "inform": {
123
+ "base": "Inform",
124
+ "ISO": "inform"
125
+ },
126
+ "ackn": {
127
+ "base": "Acknowledge",
128
+ "ISO": "feedback"
129
+ },
130
+ "reqInfo": {
131
+ "base": "Request Inform",
132
+ "ISO": "directive"
133
+ },
134
+ "backch": {
135
+ "base": "Backchannel",
136
+ "ISO": "feedback"
137
+ },
138
+ "answ": {
139
+ "base": "Answer",
140
+ "ISO": "answer"
141
+ },
142
+ "init": {
143
+ "base": "Initialise",
144
+ "ISO": "discourse"
145
+ },
146
+ "thank": {
147
+ "base": "Thank",
148
+ "ISO": "thanking"
149
+ },
150
+ "greet": {
151
+ "base": "Greet",
152
+ "ISO": "greeting"
153
+ },
154
+ "accept": {
155
+ "base": "Accept",
156
+ "ISO": "agreement"
157
+ },
158
+ "answElab": {
159
+ "base": "Answer Elaborate",
160
+ "ISO": "inform"
161
+ },
162
+ "informIntent": {
163
+ "base": "Inform Intention",
164
+ "ISO": "commissive"
165
+ },
166
+ "bye": {
167
+ "base": "Bye",
168
+ "ISO": "goodbye"
169
+ },
170
+ "direct": {
171
+ "base": "Direct",
172
+ "ISO": "directive"
173
+ },
174
+ "confirm": {
175
+ "base": "Confirm",
176
+ "ISO": "answer"
177
+ },
178
+ "expressRegret": {
179
+ "base": "Express Regret",
180
+ "ISO": "apology"
181
+ },
182
+ "hold": {
183
+ "base": "Hold",
184
+ "ISO": "turn"
185
+ },
186
+ "expressOpinion": {
187
+ "base": "Express Opinion",
188
+ "ISO": "inform"
189
+ },
190
+ "offer": {
191
+ "base": "Offer",
192
+ "ISO": "commissive"
193
+ },
194
+ "echo": {
195
+ "base": "Echo",
196
+ "ISO": "feedback"
197
+ },
198
+ "appreciate": {
199
+ "base": "Appreciate",
200
+ "ISO": "feedback"
201
+ },
202
+ "refer": {
203
+ "base": "Refer",
204
+ "ISO": "OOD"
205
+ },
206
+ "suggest": {
207
+ "base": "Suggest",
208
+ "ISO": "directive"
209
+ },
210
+ "reqDirect": {
211
+ "base": "Request Direct",
212
+ "ISO": "directive"
213
+ },
214
+ "negate": {
215
+ "base": "Negate",
216
+ "ISO": "disagreement"
217
+ },
218
+ "exclaim": {
219
+ "base": "Exclaim",
220
+ "ISO": "OOD"
221
+ },
222
+ "pardon": {
223
+ "base": "Pardon",
224
+ "ISO": "apology"
225
+ },
226
+ "identifySelf": {
227
+ "base": "Identify Self",
228
+ "ISO": "OOD"
229
+ },
230
+ "expressPossibility": {
231
+ "base": "Express Possibility",
232
+ "ISO": "inform"
233
+ },
234
+ "raiseIssue": {
235
+ "base": "Raise Issue",
236
+ "ISO": "OOD"
237
+ },
238
+ "expressWish": {
239
+ "base": "Express Wish",
240
+ "ISO": "inform"
241
+ },
242
+ "reqModal": {
243
+ "base": "Request Modal",
244
+ "ISO": "directive"
245
+ },
246
+ "complete": {
247
+ "base": "Complete",
248
+ "ISO": "OOD"
249
+ },
250
+ "directElab": {
251
+ "base": "Direct Elaborate",
252
+ "ISO": "directive"
253
+ },
254
+ "correct": {
255
+ "base": "Correct",
256
+ "ISO": "OOD"
257
+ },
258
+ "refuse": {
259
+ "base": "Refuse",
260
+ "ISO": "OOD"
261
+ },
262
+ "informIntent-hold": {
263
+ "base": "Inform Intent Hold",
264
+ "ISO": "OOD"
265
+ },
266
+ "informDisc": {
267
+ "base": "Inform Continue",
268
+ "ISO": "OOD"
269
+ },
270
+ "informCont": {
271
+ "base": "Inform Discontinue",
272
+ "ISO": "OOD"
273
+ },
274
+ "selfTalk": {
275
+ "base": "Self Talk",
276
+ "ISO": "OOD"
277
+ },
278
+ "correctSelf": {
279
+ "base": "Correct Self",
280
+ "ISO": "disagreement"
281
+ },
282
+ "expressRegret-inform": {
283
+ "base": "Express Regret Inform",
284
+ "ISO": "OOD"
285
+ },
286
+ "thank-identifySelf": {
287
+ "base": "Thank Identify Self",
288
+ "ISO": "OOD"
289
+ }
290
+ },
291
+ "maptask": {
292
+ "acknowledge": {
293
+ "base": "Acknowledge",
294
+ "ISO": "feedback"
295
+ },
296
+ "instruct": {
297
+ "base": "Instruct",
298
+ "ISO": "directive"
299
+ },
300
+ "reply_y": {
301
+ "base": "Yes-Reply",
302
+ "ISO": "answer"
303
+ },
304
+ "explain": {
305
+ "base": "Explain",
306
+ "ISO": "inform"
307
+ },
308
+ "check": {
309
+ "base": "Check",
310
+ "ISO": "feedback"
311
+ },
312
+ "ready": {
313
+ "base": "Ready",
314
+ "ISO": "discourse"
315
+ },
316
+ "align": {
317
+ "base": "Check Attention",
318
+ "ISO": "OOD"
319
+ },
320
+ "query_yn": {
321
+ "base": "Yes-No-Question",
322
+ "ISO": "propq"
323
+ },
324
+ "clarify": {
325
+ "base": "Clarify",
326
+ "ISO": "inform"
327
+ },
328
+ "reply_w": {
329
+ "base": "Non Yes-No-Reply",
330
+ "ISO": "answer"
331
+ },
332
+ "reply_n": {
333
+ "base": "No-Reply",
334
+ "ISO": "answer"
335
+ },
336
+ "query_w": {
337
+ "base": "Non Yes-No-Question",
338
+ "ISO": "setq"
339
+ }
340
+ },
341
+ "mrda": {
342
+ "s": {
343
+ "base": "Statement",
344
+ "ISO": "inform"
345
+ },
346
+ "b": {
347
+ "base": "Continuer (backchannel)",
348
+ "ISO": "feedback"
349
+ },
350
+ "fh": {
351
+ "base": "Floor Holder",
352
+ "ISO": "turn"
353
+ },
354
+ "bk": {
355
+ "base": "Acknowledge-answer",
356
+ "ISO": "feedback"
357
+ },
358
+ "aa": {
359
+ "base": "Accept",
360
+ "ISO": "agreement"
361
+ },
362
+ "df": {
363
+ "base": "Defending/Explanation",
364
+ "ISO": "inform"
365
+ },
366
+ "e": {
367
+ "base": "Expansions of y/n Answers",
368
+ "ISO": "answer"
369
+ },
370
+ "%": {
371
+ "base": "Interrupted/Abandoned/Uninterpretable",
372
+ "ISO": "OOD"
373
+ },
374
+ "rt": {
375
+ "base": "Rising Tone",
376
+ "ISO": "OOD"
377
+ },
378
+ "fg": {
379
+ "base": "Floor Grabber",
380
+ "ISO": "turn"
381
+ },
382
+ "cs": {
383
+ "base": "Offer",
384
+ "ISO": "commissive"
385
+ },
386
+ "ba": {
387
+ "base": "Assessment/Appreciation",
388
+ "ISO": "feedback"
389
+ },
390
+ "bu": {
391
+ "base": "Understanding Check",
392
+ "ISO": "feedback"
393
+ },
394
+ "d": {
395
+ "base": "Declarative-Question",
396
+ "ISO": "propq"
397
+ },
398
+ "na": {
399
+ "base": "Affirmative Non-yes Answers",
400
+ "ISO": "answer"
401
+ },
402
+ "qw": {
403
+ "base": "Wh-Question",
404
+ "ISO": "setq"
405
+ },
406
+ "ar": {
407
+ "base": "Reject",
408
+ "ISO": "disagreement"
409
+ },
410
+ "2": {
411
+ "base": "Collaborative Completion",
412
+ "ISO": "OOD"
413
+ },
414
+ "no": {
415
+ "base": "Other Answers",
416
+ "ISO": "answer"
417
+ },
418
+ "h": {
419
+ "base": "Hold Before Answer/Agreement",
420
+ "ISO": "turn"
421
+ },
422
+ "co": {
423
+ "base": "Action-directive",
424
+ "ISO": "directive"
425
+ },
426
+ "qy": {
427
+ "base": "Yes-No-question",
428
+ "ISO": "propq"
429
+ },
430
+ "nd": {
431
+ "base": "Dispreferred Answers",
432
+ "ISO": "answer"
433
+ },
434
+ "j": {
435
+ "base": "Humorous Material",
436
+ "ISO": "OOD"
437
+ },
438
+ "bd": {
439
+ "base": "Downplayer",
440
+ "ISO": "apology"
441
+ },
442
+ "cc": {
443
+ "base": "Commit",
444
+ "ISO": "commissive"
445
+ },
446
+ "ng": {
447
+ "base": "Negative Non-no Answers",
448
+ "ISO": "answer"
449
+ },
450
+ "am": {
451
+ "base": "Maybe",
452
+ "ISO": "OOD"
453
+ },
454
+ "qrr": {
455
+ "base": "Or-Clause",
456
+ "ISO": "choiceq"
457
+ },
458
+ "fe": {
459
+ "base": "Exclamation",
460
+ "ISO": "feedback"
461
+ },
462
+ "m": {
463
+ "base": "Mimic Other",
464
+ "ISO": "OOD"
465
+ },
466
+ "fa": {
467
+ "base": "Apology",
468
+ "ISO": "apology"
469
+ },
470
+ "t": {
471
+ "base": "About-task",
472
+ "ISO": "OOD"
473
+ },
474
+ "br": {
475
+ "base": "Signal-non-understanding",
476
+ "ISO": "feedback"
477
+ },
478
+ "aap": {
479
+ "base": "Accept-part",
480
+ "ISO": "OOD"
481
+ },
482
+ "qh": {
483
+ "base": "Rhetorical-Question",
484
+ "ISO": "inform"
485
+ },
486
+ "tc": {
487
+ "base": "Topic Change",
488
+ "ISO": "discourse"
489
+ },
490
+ "r": {
491
+ "base": "Repeat",
492
+ "ISO": "inform"
493
+ },
494
+ "t1": {
495
+ "base": "Self-talk",
496
+ "ISO": "OOD"
497
+ },
498
+ "t3": {
499
+ "base": "3rd-party-talk",
500
+ "ISO": "OOD"
501
+ },
502
+ "bh": {
503
+ "base": "Rhetorical-question Continue",
504
+ "ISO": "propq"
505
+ },
506
+ "bsc": {
507
+ "base": "Reject-part",
508
+ "ISO": "OOD"
509
+ },
510
+ "arp": {
511
+ "base": "Misspeak Self-Correction",
512
+ "ISO": "OOD"
513
+ },
514
+ "bs": {
515
+ "base": "Reformulate/Summarize",
516
+ "ISO": "feedback"
517
+ },
518
+ "f": {
519
+ "base": "Follow Me",
520
+ "ISO": "OOD"
521
+ },
522
+ "qr": {
523
+ "base": "Or-Question",
524
+ "ISO": "choiceq"
525
+ },
526
+ "ft": {
527
+ "base": "Thanking",
528
+ "ISO": "thanking"
529
+ },
530
+ "g": {
531
+ "base": "Tag-Question",
532
+ "ISO": "propq"
533
+ },
534
+ "qo": {
535
+ "base": "Open-Question",
536
+ "ISO": "OOD"
537
+ },
538
+ "bc": {
539
+ "base": "Correct-misspeaking",
540
+ "ISO": "OOD"
541
+ },
542
+ "by": {
543
+ "base": "Sympathy",
544
+ "ISO": "apology"
545
+ },
546
+ "fw": {
547
+ "base": "Welcome",
548
+ "ISO": "thanking"
549
+ }
550
+ },
551
+ "swda": {
552
+ "sd": {
553
+ "base": "Statement-non-opinion",
554
+ "ISO": "inform"
555
+ },
556
+ "b": {
557
+ "base": "Acknowledge (Backchannel)",
558
+ "ISO": "feedback"
559
+ },
560
+ "sv": {
561
+ "base": "Statement-opinion",
562
+ "ISO": "inform"
563
+ },
564
+ "%": {
565
+ "base": "Uninterpretable",
566
+ "ISO": "OOD"
567
+ },
568
+ "aa": {
569
+ "base": "Agree/Accept",
570
+ "ISO": "agreement"
571
+ },
572
+ "ba": {
573
+ "base": "Appreciation",
574
+ "ISO": "feedback"
575
+ },
576
+ "qy": {
577
+ "base": "Yes-No-Question",
578
+ "ISO": "propq"
579
+ },
580
+ "ny": {
581
+ "base": "Yes Answers",
582
+ "ISO": "answer"
583
+ },
584
+ "fc": {
585
+ "base": "Conventional-closing",
586
+ "ISO": "discourse"
587
+ },
588
+ "qw": {
589
+ "base": "Wh-Question",
590
+ "ISO": "setq"
591
+ },
592
+ "nn": {
593
+ "base": "No Answers",
594
+ "ISO": "answer"
595
+ },
596
+ "bk": {
597
+ "base": "Response Acknowledgement",
598
+ "ISO": "feedback"
599
+ },
600
+ "h": {
601
+ "base": "Hedge",
602
+ "ISO": "answer"
603
+ },
604
+ "qy^d": {
605
+ "base": "Declarative Yes-No-Question",
606
+ "ISO": "propq"
607
+ },
608
+ "bh": {
609
+ "base": "Backchannel in Question Form",
610
+ "ISO": "propq"
611
+ },
612
+ "^q": {
613
+ "base": "Quotation",
614
+ "ISO": "OOD"
615
+ },
616
+ "bf": {
617
+ "base": "Summarize/Reformulate",
618
+ "ISO": "feedback"
619
+ },
620
+ "fo": {
621
+ "base": "Other forward-looking functions",
622
+ "ISO": "commissive"
623
+ },
624
+ "by": {
625
+ "base": "Sympathy",
626
+ "ISO": "apology"
627
+ },
628
+ "fw": {
629
+ "base": "Welcome",
630
+ "ISO": "thanking"
631
+ },
632
+ "o_\"_bc": {
633
+ "base": "Other",
634
+ "ISO": "OOD"
635
+ },
636
+ "na": {
637
+ "base": "Affirmative Non-yes Answers",
638
+ "ISO": "answer"
639
+ },
640
+ "ad": {
641
+ "base": "Action-directive",
642
+ "ISO": "directive"
643
+ },
644
+ "^2": {
645
+ "base": "Collaborative Completion",
646
+ "ISO": "OOD"
647
+ },
648
+ "b^m": {
649
+ "base": "Repeat-phrase",
650
+ "ISO": "feedback"
651
+ },
652
+ "qo": {
653
+ "base": "Open-Question",
654
+ "ISO": "OOD"
655
+ },
656
+ "qh": {
657
+ "base": "Rhetorical-Question",
658
+ "ISO": "inform"
659
+ },
660
+ "^h": {
661
+ "base": "Hold Before Answer/Agreement",
662
+ "ISO": "turn"
663
+ },
664
+ "ar": {
665
+ "base": "Reject",
666
+ "ISO": "disagreement"
667
+ },
668
+ "ng": {
669
+ "base": "Negative Non-no Answers",
670
+ "ISO": "answer"
671
+ },
672
+ "br": {
673
+ "base": "Signal-non-understanding",
674
+ "ISO": "feedback"
675
+ },
676
+ "no": {
677
+ "base": "Other Answers",
678
+ "ISO": "answer"
679
+ },
680
+ "fp": {
681
+ "base": "Conventional-opening",
682
+ "ISO": "discourse"
683
+ },
684
+ "qrr": {
685
+ "base": "Or-Clause",
686
+ "ISO": "choiceq"
687
+ },
688
+ "arp_nd": {
689
+ "base": "Dispreferred Answers",
690
+ "ISO": "answer"
691
+ },
692
+ "t3": {
693
+ "base": "3rd-party-talk",
694
+ "ISO": "OOD"
695
+ },
696
+ "oo": {
697
+ "base": "Offers",
698
+ "ISO": "directive"
699
+ },
700
+ "co_cc": {
701
+ "base": "Options Commits",
702
+ "ISO": "commissive"
703
+ },
704
+ "aap_am": {
705
+ "base": "Maybe/Accept-part",
706
+ "ISO": "OOD"
707
+ },
708
+ "t1": {
709
+ "base": "Downplayer",
710
+ "ISO": "apology"
711
+ },
712
+ "bd": {
713
+ "base": "Self-talk",
714
+ "ISO": "OOD"
715
+ },
716
+ "^g": {
717
+ "base": "Tag-Question",
718
+ "ISO": "propq"
719
+ },
720
+ "qw^d": {
721
+ "base": "Declarative Wh-Question",
722
+ "ISO": "setq"
723
+ },
724
+ "fa": {
725
+ "base": "Apology",
726
+ "ISO": "apology"
727
+ },
728
+ "ft": {
729
+ "base": "Thanking",
730
+ "ISO": "thanking"
731
+ }
732
+ },
733
+ "frames": {
734
+ "inform": {
735
+ "base": "Inform",
736
+ "ISO": "inform"
737
+ },
738
+ "sorry": {
739
+ "base": "Sorry",
740
+ "ISO": "apology"
741
+ },
742
+ "suggest": {
743
+ "base": "Suggest",
744
+ "ISO": "directive"
745
+ },
746
+ "negate": {
747
+ "base": "Negate",
748
+ "ISO": "disagreement"
749
+ },
750
+ "thankyou": {
751
+ "base": "Thank you",
752
+ "ISO": "thanking"
753
+ },
754
+ "greeting": {
755
+ "base": "Greeting",
756
+ "ISO": "greeting"
757
+ },
758
+ "request": {
759
+ "base": "Request",
760
+ "ISO": "directive"
761
+ },
762
+ "switch_frame": {
763
+ "base": "Switch Frame",
764
+ "ISO": "OOD"
765
+ },
766
+ "offer": {
767
+ "base": "Offer",
768
+ "ISO": "commissive"
769
+ },
770
+ "request_alts": {
771
+ "base": "Request Alternative",
772
+ "ISO": "directive"
773
+ },
774
+ "null": {
775
+ "base": "Other",
776
+ "ISO": "OOD"
777
+ },
778
+ "goodbye": {
779
+ "base": "Goodbye",
780
+ "ISO": "goodbye"
781
+ },
782
+ "moreinfo": {
783
+ "base": "Request More information",
784
+ "ISO": "directive"
785
+ },
786
+ "no_result": {
787
+ "base": "No Result",
788
+ "ISO": "OOD"
789
+ },
790
+ "affirm": {
791
+ "base": "Affirm",
792
+ "ISO": "answer"
793
+ },
794
+ "request_compare": {
795
+ "base": "Request Compare",
796
+ "ISO": "directive"
797
+ },
798
+ "confirm": {
799
+ "base": "Confirm",
800
+ "ISO": "answer"
801
+ },
802
+ "hearmore": {
803
+ "base": "Hear More",
804
+ "ISO": "OOD"
805
+ },
806
+ "canthelp": {
807
+ "base": "Can not help",
808
+ "ISO": "OOD"
809
+ },
810
+ "you_are_welcome": {
811
+ "base": "Welcome",
812
+ "ISO": "thanking"
813
+ },
814
+ "reject": {
815
+ "base": "Reject",
816
+ "ISO": "disagreement"
817
+ },
818
+ None: {
819
+ "base": "None",
820
+ "ISO": "OOD"
821
+ }
822
+ },
823
+ "dyda": {
824
+ "commissive": {
825
+ "base": "Commissive",
826
+ "ISO": "commissive"
827
+ },
828
+ "directive": {
829
+ "base": "Directive",
830
+ "ISO": "directive"
831
+ },
832
+ "inform": {
833
+ "base": "Inform",
834
+ "ISO": "inform"
835
+ },
836
+ "question": {
837
+ "base": "Question",
838
+ "ISO": "OOD"
839
+ }
840
+ },
841
+ "dstc3": {
842
+ "welcomemsg": {
843
+ "base": "Welcome",
844
+ "ISO": "thanking"
845
+ },
846
+ "inform": {
847
+ "base": "Inform",
848
+ "ISO": "inform"
849
+ },
850
+ "select": {
851
+ "base": "Select",
852
+ "ISO": "OOD"
853
+ },
854
+ "expl-conf": {
855
+ "base": "Explicit Confirmation",
856
+ "ISO": "answer"
857
+ },
858
+ "affirm": {
859
+ "base": "Affirmation",
860
+ "ISO": "answer"
861
+ },
862
+ "canthelp": {
863
+ "base": "Can not help",
864
+ "ISO": "OOD"
865
+ },
866
+ "request": {
867
+ "base": "Request",
868
+ "ISO": "directive"
869
+ },
870
+ "bye": {
871
+ "base": "Goodbye",
872
+ "ISO": "goodbye"
873
+ },
874
+ "offer": {
875
+ "base": "Offer",
876
+ "ISO": "commissive"
877
+ },
878
+ "thankyou": {
879
+ "base": "Thank you",
880
+ "ISO": "thanking"
881
+ },
882
+ "negate": {
883
+ "base": "Negate",
884
+ "ISO": "disagreement"
885
+ },
886
+ "null": {
887
+ "base": "Other",
888
+ "ISO": "OOD"
889
+ },
890
+ "reqalts": {
891
+ "base": "Request Alternative",
892
+ "ISO": "directive"
893
+ },
894
+ "canthelp.missing_slot_value": {
895
+ "base": "Can not help",
896
+ "ISO": "OOD"
897
+ },
898
+ "restart": {
899
+ "base": "Restart",
900
+ "ISO": "OOD"
901
+ },
902
+ "ack": {
903
+ "base": "Acknowledge",
904
+ "ISO": "feedback"
905
+ },
906
+ "reqmore": {
907
+ "base": "Request More",
908
+ "ISO": "directive"
909
+ },
910
+ "confirm": {
911
+ "base": "Confirm",
912
+ "ISO": "answer"
913
+ },
914
+ "hello": {
915
+ "base": "Hello",
916
+ "ISO": "greeting"
917
+ },
918
+ "repeat": {
919
+ "base": "Repeat",
920
+ "ISO": "inform"
921
+ },
922
+ "deny": {
923
+ "base": "Deny",
924
+ "ISO": "answer"
925
+ },
926
+ None: {
927
+ "base": "None",
928
+ "ISO": "OOD"
929
+ }
930
+ },
931
+ "dstc8-sgd": {
932
+ "INFORM": {
933
+ "base": "Inform",
934
+ "ISO": "inform"
935
+ },
936
+ "REQUEST": {
937
+ "base": "Request",
938
+ "ISO": "directive"
939
+ },
940
+ "CONFIRM": {
941
+ "base": "Confirm",
942
+ "ISO": "answer"
943
+ },
944
+ "AFFIRM": {
945
+ "base": "Affirmation",
946
+ "ISO": "answer"
947
+ },
948
+ "NOTIFY_FAILURE": {
949
+ "base": "Notify Failure",
950
+ "ISO": "inform"
951
+ },
952
+ "THANK_YOU": {
953
+ "base": "Thank you",
954
+ "ISO": "thanking"
955
+ },
956
+ "REQ_MORE": {
957
+ "base": "Request More",
958
+ "ISO": "directive"
959
+ },
960
+ "NEGATE": {
961
+ "base": "Negate",
962
+ "ISO": "disagreement"
963
+ },
964
+ "GOODBYE": {
965
+ "base": "Goodbye",
966
+ "ISO": "goodbye"
967
+ },
968
+ "NOTIFY_SUCCESS": {
969
+ "base": "Notify Success",
970
+ "ISO": "inform"
971
+ },
972
+ "INFORM_INTENT": {
973
+ "base": "Inform Intention",
974
+ "ISO": "commissive"
975
+ },
976
+ "OFFER": {
977
+ "base": "Offer",
978
+ "ISO": "commissive"
979
+ },
980
+ "SELECT": {
981
+ "base": "Select",
982
+ "ISO": "OOD"
983
+ },
984
+ "OFFER_INTENT": {
985
+ "base": "Offer Intent",
986
+ "ISO": "commissive"
987
+ },
988
+ "NEGATE_INTENT": {
989
+ "base": "Negate Intent",
990
+ "ISO": "disagreement"
991
+ },
992
+ "REQUEST_ALTS": {
993
+ "base": "Request Alternatives",
994
+ "ISO": "directive"
995
+ },
996
+ "AFFIRM_INTENT": {
997
+ "base": "Affirm Intent",
998
+ "ISO": "answer"
999
+ }
1000
+ }
1001
+ }
1002
+
1003
+
1004
+ class DAISOConfig(datasets.BuilderConfig):
1005
+ """BuilderConfig for DAISO."""
1006
+
1007
+ def __init__(self, label_classes, features, speakers, data_url, citation, url, **kwargs):
1008
+ """BuilderConfig for DAISO.
1009
+ Args:
1010
+ features: `list[string]`, list of the features that will appear in the
1011
+ feature dict. Should not include "label".
1012
+ data_url: `string`, url to download the csv file from.
1013
+ citation: `string`, citation for the data set.
1014
+ url: `string`, url for information about the data set.
1015
+ label_classes: `list[string]`, the list of classes for the label if the
1016
+ label is present as a string. Non-string labels will be cast to either
1017
+ 'False' or 'True'.
1018
+ **kwargs: keyword arguments forwarded to super.
1019
+ """
1020
+ super(DAISOConfig, self).__init__(version=_VERSION, **kwargs)
1021
+ self.label_classes = label_classes
1022
+ self.features = features
1023
+ self.speakers = speakers
1024
+ self.data_url = data_url
1025
+ self.citation = citation
1026
+ self.url = url
1027
+
1028
+
1029
+ # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
1030
+ class DAISO(datasets.GeneratorBasedBuilder):
1031
+ """TODO: Short description of my dataset."""
1032
+
1033
+ # This is an example of a dataset with multiple configurations.
1034
+ # If you don't want/need to define several sub-sets in your dataset,
1035
+ # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
1036
+
1037
+ # If you need to make complex sub-parts in the datasets with configurable options
1038
+ # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
1039
+ # BUILDER_CONFIG_CLASS = MyBuilderConfig
1040
+
1041
+ # You will be able to load one or the other configurations in the following list with
1042
+ # data = datasets.load_dataset('my_dataset', 'first_domain')
1043
+ # data = datasets.load_dataset('my_dataset', 'second_domain')
1044
+ BUILDER_CONFIGS = [
1045
+ DAISOConfig(
1046
+ name="ami",
1047
+ description=textwrap.dedent(
1048
+ """\
1049
+ """
1050
+ ),
1051
+ label_classes=LABELS_MAPPING["ami"],
1052
+ speakers=['A', 'B', 'D', 'C'],
1053
+ features=[
1054
+ "Utterance",
1055
+ "Dialogue_Act",
1056
+ "Speaker",
1057
+ "Dialogue_Id",
1058
+ "Dialogue_Act_ISO"
1059
+ ],
1060
+ data_url={
1061
+ "train": _URL + "/ami/train.csv",
1062
+ "test": _URL + "/ami/test.csv",
1063
+ },
1064
+ citation=textwrap.dedent(
1065
+ """\
1066
+ @article{carletta2006ami,
1067
+ author = "Carletta, J.",
1068
+ title = "Announcing the AMI Meeting Corpus",
1069
+ journal = "The ELRA Newsletter",
1070
+ volume = "11",
1071
+ number = "1",
1072
+ year = "2006",
1073
+ pages = "3-5",
1074
+ month = "January-March"
1075
+ }"""
1076
+ ),
1077
+ url="https://groups.inf.ed.ac.uk/ami/corpus/",
1078
+ ),
1079
+ DAISOConfig(
1080
+ name="oasis",
1081
+ description=textwrap.dedent(
1082
+ """\
1083
+ """
1084
+ ),
1085
+ label_classes=LABELS_MAPPING["oasis"],
1086
+ speakers=['b', 'a'],
1087
+ features=[
1088
+ "Speaker",
1089
+ "Utterance",
1090
+ "Dialogue_Act",
1091
+ "Dialogue_Id",
1092
+ "Dialogue_Act_ISO"
1093
+ ],
1094
+ data_url={
1095
+ "train": _URL + "/oasis/train.csv",
1096
+ "dev": _URL + "/oasis/dev.csv",
1097
+ "test": _URL + "/oasis/test.csv",
1098
+ },
1099
+ citation=textwrap.dedent(
1100
+ """\
1101
+ @inproceedings{leech2003generic,
1102
+ title={Generic speech act annotation for task-oriented dialogues},
1103
+ author={Leech, Geoffrey and Weisser, Martin},
1104
+ booktitle={Proceedings of the corpus linguistics 2003 conference},
1105
+ volume={16},
1106
+ pages={441--446},
1107
+ year={2003},
1108
+ organization={Lancaster: Lancaster University}
1109
+ }"""
1110
+ ),
1111
+ url="http://groups.inf.ed.ac.uk/oasis/",
1112
+ ),
1113
+ DAISOConfig(
1114
+ name="maptask",
1115
+ description=textwrap.dedent(
1116
+ """\
1117
+ """
1118
+ ),
1119
+ label_classes=LABELS_MAPPING["maptask"],
1120
+ speakers=['g', 'f'],
1121
+ features=[
1122
+ "Speaker",
1123
+ "Utterance",
1124
+ "Dialogue_Act",
1125
+ "Dialogue_Id",
1126
+ "Dialogue_Act_ISO"
1127
+ ],
1128
+ data_url={
1129
+ "train": _URL + "/maptask/train.csv",
1130
+ "dev": _URL + "/maptask/dev.csv",
1131
+ "test": _URL + "/maptask/test.csv",
1132
+ },
1133
+ citation=textwrap.dedent(
1134
+ """\
1135
+ @inproceedings{thompson1993hcrc,
1136
+ title={The HCRC map task corpus: natural dialogue for speech recognition},
1137
+ author={Thompson, Henry S and Anderson, Anne H and Bard, Ellen Gurman and Doherty-Sneddon,
1138
+ Gwyneth and Newlands, Alison and Sotillo, Cathy},
1139
+ booktitle={HUMAN LANGUAGE TECHNOLOGY: Proceedings of a Workshop Held at Plainsboro, New Jersey, March 21-24, 1993},
1140
+ year={1993}
1141
+ }"""
1142
+ ),
1143
+ url="http://groups.inf.ed.ac.uk/maptask/",
1144
+ ),
1145
+ DAISOConfig(
1146
+ name="mrda",
1147
+ description=textwrap.dedent(
1148
+ """\
1149
+ """
1150
+ ),
1151
+ label_classes=LABELS_MAPPING["mrda"],
1152
+ speakers=['me003', 'me012', 'fe004', 'mn015', 'me010', 'me045', 'mn036', 'me013', 'me001', 'me011', 'mn005',
1153
+ 'fe016', 'fe008', 'mn017', 'me018', 'mn014', 'mn009', 'me026', 'me051', 'mn007', 'me034', 'me006',
1154
+ 'fn002', 'mn058', 'mn052', 'fe046', 'fn050', 'me025', 'mn048', 'mn047', 'mn059', 'me022', 'me028',
1155
+ 'mn082', 'mn021', 'fn083', 'mn030', 'mn081', 'mn035', 'mn040', 'mn049', 'me055', 'mn038', 'me056',
1156
+ 'mn057', 'fe068', 'fe069', 'fe066', 'me070', 'fe067', 'fe041', 'fn043'],
1157
+ features=[
1158
+ "Speaker",
1159
+ "Utterance",
1160
+ "Basic_DA",
1161
+ "General_DA",
1162
+ "Dialogue_Act",
1163
+ "Dialogue_Id",
1164
+ "Dialogue_Act_ISO"
1165
+ ],
1166
+ data_url={
1167
+ "train": _URL + "/mrda/train.csv",
1168
+ "dev": _URL + "/mrda/dev.csv",
1169
+ "test": _URL + "/mrda/test.csv",
1170
+ },
1171
+ citation=textwrap.dedent(
1172
+ """\
1173
+ @techreport{shriberg2004icsi,
1174
+ title={The ICSI meeting recorder dialog act (MRDA) corpus},
1175
+ author={Shriberg, Elizabeth and Dhillon, Raj and Bhagat, Sonali and Ang, Jeremy and Carvey, Hannah},
1176
+ year={2004},
1177
+ institution={INTERNATIONAL COMPUTER SCIENCE INST BERKELEY CA}
1178
+ }"""
1179
+ ),
1180
+ url="https://www.aclweb.org/anthology/W04-2319",
1181
+ ),
1182
+ DAISOConfig(
1183
+ name="swda",
1184
+ description=textwrap.dedent(
1185
+ """\
1186
+ Switchboard Dialogue Act Corpus.
1187
+ Grouping procedure is different from original recommendations.
1188
+ Contains detailed split for specific labels for ISO mapping.
1189
+ """
1190
+ ),
1191
+ label_classes=LABELS_MAPPING["swda"],
1192
+ speakers=['A', 'B'],
1193
+ features=[
1194
+ "Speaker",
1195
+ "Utterance",
1196
+ "Dialogue_Act",
1197
+ "Dialogue_Id",
1198
+ "Dialogue_Act_ISO"
1199
+ ],
1200
+ data_url={
1201
+ "train": _URL + "/swda/train.csv",
1202
+ "dev": _URL + "/swda/dev.csv",
1203
+ "test": _URL + "/swda/test.csv",
1204
+ },
1205
+ citation=textwrap.dedent(
1206
+ """\
1207
+ @article{stolcke2000dialogue,
1208
+ title={Dialogue act modeling for automatic tagging and recognition of conversational speech},
1209
+ author={Stolcke, Andreas and Ries, Klaus and Coccaro, Noah and Shriberg, Elizabeth and
1210
+ Bates, Rebecca and Jurafsky, Daniel and Taylor, Paul and Martin, Rachel and Ess-Dykema,
1211
+ Carol Van and Meteer, Marie},
1212
+ journal={Computational linguistics},
1213
+ volume={26},
1214
+ number={3},
1215
+ pages={339--373},
1216
+ year={2000},
1217
+ publisher={MIT Press}
1218
+ }"""
1219
+ ),
1220
+ url="https://web.stanford.edu/~jurafsky/ws97/",
1221
+ ),
1222
+ DAISOConfig(
1223
+ name="frames",
1224
+ description=textwrap.dedent(
1225
+ """\
1226
+ """
1227
+ ),
1228
+ label_classes=LABELS_MAPPING["frames"],
1229
+ features=[
1230
+ "Speaker",
1231
+ "Utterance",
1232
+ "Dialogue_Act",
1233
+ "Dialogue_Id",
1234
+ "Dialogue_Act_ISO"
1235
+ ],
1236
+ speakers=['USR', 'SYS'],
1237
+ data_url={
1238
+ "train": _URL + "/frames/train.csv",
1239
+ "test": _URL + "/frames/test.csv",
1240
+ },
1241
+ citation=textwrap.dedent(
1242
+ """\
1243
+ @inproceedings{el-asri-etal-2017-frames,
1244
+ title = "{F}rames: a corpus for adding memory to goal-oriented dialogue systems",
1245
+ author = "El Asri, Layla and
1246
+ Schulz, Hannes and
1247
+ Sharma, Shikhar and
1248
+ Zumer, Jeremie and
1249
+ Harris, Justin and
1250
+ Fine, Emery and
1251
+ Mehrotra, Rahul and
1252
+ Suleman, Kaheer",
1253
+ booktitle = "Proceedings of the 18th Annual {SIG}dial Meeting on Discourse and Dialogue",
1254
+ month = aug,
1255
+ year = "2017",
1256
+ address = {Saarbr{\"u}cken, Germany},
1257
+ publisher = "Association for Computational Linguistics",
1258
+ url = "https://aclanthology.org/W17-5526",
1259
+ doi = "10.18653/v1/W17-5526",
1260
+ pages = "207--219",
1261
+ abstract = "This paper proposes a new dataset, Frames, composed of 1369 human-human dialogues with an average of 15 turns per dialogue. This corpus contains goal-oriented dialogues between users who are given some constraints to book a trip and assistants who search a database to find appropriate trips. The users exhibit complex decision-making behaviour which involve comparing trips, exploring different options, and selecting among the trips that were discussed during the dialogue. To drive research on dialogue systems towards handling such behaviour, we have annotated and released the dataset and we propose in this paper a task called frame tracking. This task consists of keeping track of different semantic frames throughout each dialogue. We propose a rule-based baseline and analyse the frame tracking task through this baseline.",
1262
+ }"""
1263
+ ),
1264
+ url="http://datasets.maluuba.com/Frames",
1265
+ ),
1266
+ DAISOConfig(
1267
+ name="dyda",
1268
+ description=textwrap.dedent(
1269
+ """\
1270
+ """
1271
+ ),
1272
+ label_classes=LABELS_MAPPING["dyda"],
1273
+ # {"commissive": {
1274
+ # "base": "Commissive",
1275
+ # "ISO": "commissive"
1276
+ # },
1277
+ # "directive": {
1278
+ # "base": "Directive",
1279
+ # "ISO": "directive"
1280
+ # },
1281
+ # "inform": {
1282
+ # "base": "Inform",
1283
+ # "ISO": "inform"
1284
+ # },
1285
+ # "question": {
1286
+ # "base": "Question",
1287
+ # "ISO": None
1288
+ # }
1289
+ # },
1290
+ features=[
1291
+ "Speaker",
1292
+ "Utterance",
1293
+ "Dialogue_Act",
1294
+ "Emotion",
1295
+ "Dialogue_Id",
1296
+ "Dialogue_Act_ISO"
1297
+ ],
1298
+ speakers=["sp0", "sp1"],
1299
+ data_url={
1300
+ "train": _URL + "/dyda/train.csv",
1301
+ "dev": _URL + "/dyda/dev.csv",
1302
+ "test": _URL + "/dyda/test.csv",
1303
+ },
1304
+ citation=textwrap.dedent(
1305
+ """\
1306
+ @InProceedings{li2017dailydialog,
1307
+ author = {Li, Yanran and Su, Hui and Shen, Xiaoyu and Li, Wenjie and Cao, Ziqiang and Niu, Shuzi},
1308
+ title = {DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset},
1309
+ booktitle = {Proceedings of The 8th International Joint Conference on Natural Language Processing (IJCNLP 2017)},
1310
+ year = {2017}
1311
+ }"""
1312
+ ),
1313
+ url="http://yanran.li/dailydialog.html",
1314
+ ),
1315
+ DAISOConfig(
1316
+ name="dstc3",
1317
+ description=textwrap.dedent(
1318
+ """\
1319
+ """
1320
+ ),
1321
+ label_classes=LABELS_MAPPING["dstc3"],
1322
+ features=[
1323
+ "Speaker",
1324
+ "Utterance",
1325
+ "Dialogue_Act",
1326
+ "Dialogue_Id",
1327
+ "Dialogue_Act_ISO"
1328
+ ],
1329
+ speakers=['SYS', 'USR'],
1330
+ data_url={
1331
+ "train": _URL + "/dstc3/train.csv",
1332
+ "test": _URL + "/dstc3/test.csv",
1333
+ },
1334
+ citation=textwrap.dedent(
1335
+ """\
1336
+ @article{Henderson2014TheTD,
1337
+ title={The third Dialog State Tracking Challenge},
1338
+ author={Matthew Henderson and Blaise Thomson and J. Williams},
1339
+ journal={2014 IEEE Spoken Language Technology Workshop (SLT)},
1340
+ year={2014},
1341
+ pages={324-329},
1342
+ url={https://api.semanticscholar.org/CorpusID:17478615}
1343
+ }"""
1344
+ ),
1345
+ url="http://camdial.org/~mh521/dstc/",
1346
+ ),
1347
+ DAISOConfig(
1348
+ name="dstc8-sgd",
1349
+ description=textwrap.dedent(
1350
+ """\
1351
+ """
1352
+ ),
1353
+ label_classes=LABELS_MAPPING["dstc8-sgd"],
1354
+ features=[
1355
+ "Speaker",
1356
+ "Utterance",
1357
+ "Dialogue_Act",
1358
+ "Dialogue_Id",
1359
+ "Dialogue_Act_ISO"
1360
+ ],
1361
+ speakers=['USER', 'SYSTEM'],
1362
+ data_url={
1363
+ "train": _URL + "/dstc8-sgd/train.csv",
1364
+ "dev": _URL + "/dstc8-sgd/dev.csv",
1365
+ "test": _URL + "/dstc8-sgd/test.csv",
1366
+ },
1367
+ citation=textwrap.dedent(
1368
+ """\
1369
+ @inproceedings{rastogi2020towards,
1370
+ title={Towards scalable multi-domain conversational agents: The schema-guided dialogue dataset},
1371
+ author={Rastogi, Abhinav and Zang, Xiaoxue and Sunkara, Srinivas and Gupta, Raghav and Khaitan, Pranav},
1372
+ booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
1373
+ volume={34},
1374
+ number={05},
1375
+ pages={8689--8696},
1376
+ year={2020}
1377
+ }"""
1378
+ ),
1379
+ url="https://github.com/google-research-datasets/dstc8-schema-guided-dialogue",
1380
+ ),
1381
+
1382
+ ]
1383
+
1384
+ DEFAULT_CONFIG_NAME = "dyda" # It's not mandatory to have a default configuration. Just use one if it make sense.
1385
+
1386
+ def _info(self):
1387
+ # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
1388
+ features = {feature: datasets.Value("string") for feature in self.config.features}
1389
+ if self.config.label_classes:
1390
+ features["Label"] = datasets.features.ClassLabel(names=list(
1391
+ set(['OOD' if label == 'null' or label is None or label == 'None' or label == 'OOD' else label for label in
1392
+ list(self.config.label_classes.keys())])
1393
+ ))
1394
+ features["Label_ISO"] = datasets.features.ClassLabel(
1395
+ names=list(set([map.get("ISO", "OOD") for map in self.config.label_classes.values()])))
1396
+ features["Idx"] = datasets.Value("int32")
1397
+ features["Speaker_Id"] = datasets.features.ClassLabel(names=self.config.speakers)
1398
+ # if self.config.name == "": # This is the name of the configuration selected in BUILDER_CONFIGS above
1399
+ # features = datasets.Features(
1400
+ # {
1401
+ # "sentence": datasets.Value("string"),
1402
+ # "option1": datasets.Value("string"),
1403
+ # "answer": datasets.Value("string")
1404
+ # # These are the features of your dataset like images, labels ...
1405
+ # }
1406
+ # )
1407
+ return datasets.DatasetInfo(
1408
+ # This is the description that will appear on the datasets page.
1409
+ description=_DAISO_DESCRIPTION,
1410
+ # This defines the different columns of the dataset and their types
1411
+ features=datasets.Features(features),
1412
+ # Here we define them above because they are different between the two configurations
1413
+ # Homepage of the dataset for documentation
1414
+ homepage=self.config.url,
1415
+ # License for the dataset if available
1416
+ # license=_LICENSE,
1417
+ # Citation for the dataset
1418
+ citation=self.config.citation + "\n" + _DAISO_CITATION,
1419
+ )
1420
+
1421
+ def _split_generators(self, dl_manager):
1422
+ # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
1423
+ # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
1424
+
1425
+ # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
1426
+ # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
1427
+ # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
1428
+ data_files = dl_manager.download(self.config.data_url)
1429
+ splits = []
1430
+ if "train" in data_files:
1431
+ splits.append(datasets.SplitGenerator(
1432
+ name=datasets.Split.TRAIN,
1433
+ # These kwargs will be passed to _generate_examples
1434
+ gen_kwargs={
1435
+ "file": data_files["train"],
1436
+ "split": "train",
1437
+ },
1438
+ ))
1439
+ if "dev" in data_files:
1440
+ splits.append(datasets.SplitGenerator(
1441
+ name=datasets.Split.VALIDATION,
1442
+ # These kwargs will be passed to _generate_examples
1443
+ gen_kwargs={
1444
+ "file": data_files["dev"],
1445
+ "split": "dev",
1446
+ },
1447
+ ))
1448
+ if "test" in data_files:
1449
+ splits.append(datasets.SplitGenerator(
1450
+ name=datasets.Split.TEST,
1451
+ # These kwargs will be passed to _generate_examples
1452
+ gen_kwargs={
1453
+ "file": data_files["test"],
1454
+ "split": "test"
1455
+ },
1456
+ ))
1457
+ return splits
1458
+
1459
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
1460
+ def _generate_examples(self, file, split):
1461
+ # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
1462
+ df = pd.read_csv(file, delimiter=",", quotechar='"', dtype=str)
1463
+ # df['Dialogue_Act'] = df['Dialogue_Act'].apply(lambda x: "OOD" if pd.isna(x) else x)
1464
+ # df['Dialogue_Act_ISO'] = df['Dialogue_Act_ISO'].apply(lambda x: "OOD" if pd.isna(x) else x)
1465
+ df['Dialogue_Act'] = df['Dialogue_Act'].apply(lambda x: "OOD" if x is None or x == 'None' or pd.isna(x) else x)
1466
+ df['Dialogue_Act_ISO'] = df['Dialogue_Act_ISO'].apply(lambda x: "OOD" if x is None or x == 'None' or pd.isna(x) else x)
1467
+
1468
+ rows = df.to_dict(orient="records")
1469
+
1470
+ for n, row in enumerate(rows):
1471
+ example = row
1472
+ example["Idx"] = n
1473
+
1474
+ if "Dialogue_Act" in example:
1475
+ label = example["Dialogue_Act"]
1476
+ example["Label"] = label
1477
+ example["Label_ISO"] = self.config.label_classes.get(label,{}).get("ISO","OOD")
1478
+
1479
+ if "Speaker" in example:
1480
+ speaker = example["Speaker"]
1481
+ example["Speaker_Id"] = speaker
1482
+
1483
+ yield example["Idx"], example