igorktech commited on
Commit
8e5fadd
·
1 Parent(s): 759a49e

minor(dev): update dataset config

Browse files
Files changed (1) hide show
  1. daiso.py +1108 -21
daiso.py CHANGED
@@ -52,11 +52,947 @@ _LICENSE = ""
52
  # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
53
  _URL = "https://raw.githubusercontent.com/igorktech/DAISO-benchmark/dev"
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  class DAISOConfig(datasets.BuilderConfig):
57
  """BuilderConfig for DAISO."""
58
 
59
- def __init__(self,label_classes, features, data_url, citation, url, **kwargs):
60
  """BuilderConfig for DAISO.
61
  Args:
62
  features: `list[string]`, list of the features that will appear in the
@@ -93,30 +1029,142 @@ class DAISO(datasets.GeneratorBasedBuilder):
93
  # data = datasets.load_dataset('my_dataset', 'first_domain')
94
  # data = datasets.load_dataset('my_dataset', 'second_domain')
95
  BUILDER_CONFIGS = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  DAISOConfig(
97
  name="dyda",
98
  description=textwrap.dedent(
99
  """\
100
  """
101
  ),
102
- label_classes =
103
- {"commissive": {
104
- "base": "Commissive",
105
- "ISO": "commissive"
106
- },
107
- "directive": {
108
- "base": "Directive",
109
- "ISO": "directive"
110
- },
111
- "inform": {
112
- "base": "Inform",
113
- "ISO": "inform"
114
- },
115
- "question": {
116
- "base": "Question",
117
- "ISO": None
118
- }
119
- },
120
  features=[
121
  "Utterance",
122
  "Dialogue_Act",
@@ -139,7 +1187,45 @@ class DAISO(datasets.GeneratorBasedBuilder):
139
  }"""
140
  ),
141
  url="http://yanran.li/dailydialog.html",
142
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  ]
144
 
145
  DEFAULT_CONFIG_NAME = "dyda" # It's not mandatory to have a default configuration. Just use one if it make sense.
@@ -149,7 +1235,8 @@ class DAISO(datasets.GeneratorBasedBuilder):
149
  features = {feature: datasets.Value("string") for feature in self.config.features}
150
  if self.config.label_classes:
151
  features["Label"] = datasets.features.ClassLabel(names=list(self.config.label_classes.keys()))
152
- features["Label_ISO"] = datasets.features.ClassLabel(names=[ map.get("ISO") for map in self.config.label_classes.values()])
 
153
  features["Idx"] = datasets.Value("int32")
154
  # if self.config.name == "": # This is the name of the configuration selected in BUILDER_CONFIGS above
155
  # features = datasets.Features(
 
52
  # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
53
  _URL = "https://raw.githubusercontent.com/igorktech/DAISO-benchmark/dev"
54
 
55
+ LABELS_MAPPING = {
56
+ "ami": {
57
+ "bck": {
58
+ "base": "Backchannel",
59
+ "ISO": "feedback"
60
+ },
61
+ "stl": {
62
+ "base": "Stall",
63
+ "ISO": None
64
+ },
65
+ "fra": {
66
+ "base": "Fragment",
67
+ "ISO": None
68
+ },
69
+ "inf": {
70
+ "base": "Inform",
71
+ "ISO": "inform"
72
+ },
73
+ "sug": {
74
+ "base": "Suggest",
75
+ "ISO": "directive"
76
+ },
77
+ "ass": {
78
+ "base": "Assess",
79
+ "ISO": "feedback"
80
+ },
81
+ "el.inf": {
82
+ "base": "Elicit-Inform",
83
+ "ISO": None
84
+ },
85
+ "el.sug": {
86
+ "base": "Elicit-Offer-Or-Suggestion",
87
+ "ISO": "directive"
88
+ },
89
+ "el.ass": {
90
+ "base": "Elicit-Assessment",
91
+ "ISO": None
92
+ },
93
+ "el.und": {
94
+ "base": "Elicit-Comment-Understanding",
95
+ "ISO": None
96
+ },
97
+ "off": {
98
+ "base": "Offer",
99
+ "ISO": "commissive"
100
+ },
101
+ "und": {
102
+ "base": "Comment-About-Understanding",
103
+ "ISO": "feedback"
104
+ },
105
+ "be.pos": {
106
+ "base": "Be-Positive",
107
+ "ISO": None
108
+ },
109
+ "be.neg": {
110
+ "base": "Be-Negative",
111
+ "ISO": None
112
+ },
113
+ "oth": {
114
+ "base": "Other",
115
+ "ISO": None
116
+ }
117
+ },
118
+ "oasis": {
119
+ "inform": {
120
+ "base": "Inform",
121
+ "ISO": "inform"
122
+ },
123
+ "ackn": {
124
+ "base": "Acknowledge",
125
+ "ISO": "feedback"
126
+ },
127
+ "reqInfo": {
128
+ "base": "Request Inform",
129
+ "ISO": "directive"
130
+ },
131
+ "backch": {
132
+ "base": "Backchannel",
133
+ "ISO": "feedback"
134
+ },
135
+ "answ": {
136
+ "base": "Answer",
137
+ "ISO": "answer"
138
+ },
139
+ "init": {
140
+ "base": "Initialise",
141
+ "ISO": "discourse"
142
+ },
143
+ "thank": {
144
+ "base": "Thank",
145
+ "ISO": "thanking"
146
+ },
147
+ "greet": {
148
+ "base": "Greet",
149
+ "ISO": "greeting"
150
+ },
151
+ "accept": {
152
+ "base": "Accept",
153
+ "ISO": "agreement"
154
+ },
155
+ "answElab": {
156
+ "base": "Answer Elaborate",
157
+ "ISO": "inform"
158
+ },
159
+ "informIntent": {
160
+ "base": "Inform Intention",
161
+ "ISO": "commissive"
162
+ },
163
+ "bye": {
164
+ "base": "Bye",
165
+ "ISO": "goodbye"
166
+ },
167
+ "direct": {
168
+ "base": "Direct",
169
+ "ISO": "directive"
170
+ },
171
+ "confirm": {
172
+ "base": "Confirm",
173
+ "ISO": "answer"
174
+ },
175
+ "expressRegret": {
176
+ "base": "Express Regret",
177
+ "ISO": "apology"
178
+ },
179
+ "hold": {
180
+ "base": "Hold",
181
+ "ISO": "turn"
182
+ },
183
+ "expressOpinion": {
184
+ "base": "Express Opinion",
185
+ "ISO": "inform"
186
+ },
187
+ "offer": {
188
+ "base": "Offer",
189
+ "ISO": "commissive"
190
+ },
191
+ "echo": {
192
+ "base": "Echo",
193
+ "ISO": "feedback"
194
+ },
195
+ "appreciate": {
196
+ "base": "Appreciate",
197
+ "ISO": "feedback"
198
+ },
199
+ "refer": {
200
+ "base": "Refer",
201
+ "ISO": None
202
+ },
203
+ "suggest": {
204
+ "base": "Suggest",
205
+ "ISO": "directive"
206
+ },
207
+ "reqDirect": {
208
+ "base": "Request Direct",
209
+ "ISO": "directive"
210
+ },
211
+ "negate": {
212
+ "base": "Negate",
213
+ "ISO": "disagreement"
214
+ },
215
+ "exclaim": {
216
+ "base": "Exclaim",
217
+ "ISO": None
218
+ },
219
+ "pardon": {
220
+ "base": "Pardon",
221
+ "ISO": "apology"
222
+ },
223
+ "identifySelf": {
224
+ "base": "Identify Self",
225
+ "ISO": None
226
+ },
227
+ "expressPossibility": {
228
+ "base": "Express Possibility",
229
+ "ISO": "inform"
230
+ },
231
+ "raiseIssue": {
232
+ "base": "Raise Issue",
233
+ "ISO": None
234
+ },
235
+ "expressWish": {
236
+ "base": "Express Wish",
237
+ "ISO": "inform"
238
+ },
239
+ "reqModal": {
240
+ "base": "Request Modal",
241
+ "ISO": "directive"
242
+ },
243
+ "complete": {
244
+ "base": "Complete",
245
+ "ISO": None
246
+ },
247
+ "directElab": {
248
+ "base": "Direct Elaborate",
249
+ "ISO": "directive"
250
+ },
251
+ "correct": {
252
+ "base": "Correct",
253
+ "ISO": None
254
+ },
255
+ "refuse": {
256
+ "base": "Refuse",
257
+ "ISO": None
258
+ },
259
+ "informIntent-hold": {
260
+ "base": "Inform Intent Hold",
261
+ "ISO": None
262
+ },
263
+ "informDisc": {
264
+ "base": "Inform Continue",
265
+ "ISO": None
266
+ },
267
+ "informCont": {
268
+ "base": "Inform Discontinue",
269
+ "ISO": None
270
+ },
271
+ "selfTalk": {
272
+ "base": "Self Talk",
273
+ "ISO": None
274
+ },
275
+ "correctSelf": {
276
+ "base": "Correct Self",
277
+ "ISO": "disagreement"
278
+ },
279
+ "expressRegret-inform": {
280
+ "base": "Express Regret Inform",
281
+ "ISO": None
282
+ },
283
+ "thank-identifySelf": {
284
+ "base": "Thank Identify Self",
285
+ "ISO": None
286
+ }
287
+ },
288
+ "maptask": {
289
+ "acknowledge": {
290
+ "base": "Acknowledge",
291
+ "ISO": "feedback"
292
+ },
293
+ "instruct": {
294
+ "base": "Instruct",
295
+ "ISO": "directive"
296
+ },
297
+ "reply_y": {
298
+ "base": "Yes-Reply",
299
+ "ISO": "answer"
300
+ },
301
+ "explain": {
302
+ "base": "Explain",
303
+ "ISO": "inform"
304
+ },
305
+ "check": {
306
+ "base": "Check",
307
+ "ISO": "feedback"
308
+ },
309
+ "ready": {
310
+ "base": "Ready",
311
+ "ISO": "discourse"
312
+ },
313
+ "align": {
314
+ "base": "Check Attention",
315
+ "ISO": None
316
+ },
317
+ "query_yn": {
318
+ "base": "Yes-No-Question",
319
+ "ISO": "propq"
320
+ },
321
+ "clarify": {
322
+ "base": "Clarify",
323
+ "ISO": "inform"
324
+ },
325
+ "reply_w": {
326
+ "base": "Non Yes-No-Reply",
327
+ "ISO": "answer"
328
+ },
329
+ "reply_n": {
330
+ "base": "No-Reply",
331
+ "ISO": "answer"
332
+ },
333
+ "query_w": {
334
+ "base": "Non Yes-No-Question",
335
+ "ISO": "setq"
336
+ }
337
+ },
338
+ "mrda": {
339
+ "s": {
340
+ "base": "Statement",
341
+ "ISO": "inform"
342
+ },
343
+ "b": {
344
+ "base": "Continuer (backchannel)",
345
+ "ISO": "feedback"
346
+ },
347
+ "fh": {
348
+ "base": "Floor Holder",
349
+ "ISO": "turn"
350
+ },
351
+ "bk": {
352
+ "base": "Acknowledge-answer",
353
+ "ISO": "feedback"
354
+ },
355
+ "aa": {
356
+ "base": "Accept",
357
+ "ISO": "agreement"
358
+ },
359
+ "df": {
360
+ "base": "Defending/Explanation",
361
+ "ISO": "inform"
362
+ },
363
+ "e": {
364
+ "base": "Expansions of y/n Answers",
365
+ "ISO": "answer"
366
+ },
367
+ "%": {
368
+ "base": "Interrupted/Abandoned/Uninterpretable",
369
+ "ISO": None
370
+ },
371
+ "rt": {
372
+ "base": "Rising Tone",
373
+ "ISO": None
374
+ },
375
+ "fg": {
376
+ "base": "Floor Grabber",
377
+ "ISO": "turn"
378
+ },
379
+ "cs": {
380
+ "base": "Offer",
381
+ "ISO": "commissive"
382
+ },
383
+ "ba": {
384
+ "base": "Assessment/Appreciation",
385
+ "ISO": "feedback"
386
+ },
387
+ "bu": {
388
+ "base": "Understanding Check",
389
+ "ISO": "feedback"
390
+ },
391
+ "d": {
392
+ "base": "Declarative-Question",
393
+ "ISO": "propq"
394
+ },
395
+ "na": {
396
+ "base": "Affirmative Non-yes Answers",
397
+ "ISO": "answer"
398
+ },
399
+ "qw": {
400
+ "base": "Wh-Question",
401
+ "ISO": "setq"
402
+ },
403
+ "ar": {
404
+ "base": "Reject",
405
+ "ISO": "disagreement"
406
+ },
407
+ "2": {
408
+ "base": "Collaborative Completion",
409
+ "ISO": None
410
+ },
411
+ "no": {
412
+ "base": "Other Answers",
413
+ "ISO": "answer"
414
+ },
415
+ "h": {
416
+ "base": "Hold Before Answer/Agreement",
417
+ "ISO": "turn"
418
+ },
419
+ "co": {
420
+ "base": "Action-directive",
421
+ "ISO": "directive"
422
+ },
423
+ "qy": {
424
+ "base": "Yes-No-question",
425
+ "ISO": "propq"
426
+ },
427
+ "nd": {
428
+ "base": "Dispreferred Answers",
429
+ "ISO": "answer"
430
+ },
431
+ "j": {
432
+ "base": "Humorous Material",
433
+ "ISO": None
434
+ },
435
+ "bd": {
436
+ "base": "Downplayer",
437
+ "ISO": "apology"
438
+ },
439
+ "cc": {
440
+ "base": "Commit",
441
+ "ISO": "commissive"
442
+ },
443
+ "ng": {
444
+ "base": "Negative Non-no Answers",
445
+ "ISO": "answer"
446
+ },
447
+ "am": {
448
+ "base": "Maybe",
449
+ "ISO": None
450
+ },
451
+ "qrr": {
452
+ "base": "Or-Clause",
453
+ "ISO": "choiceq"
454
+ },
455
+ "fe": {
456
+ "base": "Exclamation",
457
+ "ISO": "feedback"
458
+ },
459
+ "m": {
460
+ "base": "Mimic Other",
461
+ "ISO": None
462
+ },
463
+ "fa": {
464
+ "base": "Apology",
465
+ "ISO": "apology"
466
+ },
467
+ "t": {
468
+ "base": "About-task",
469
+ "ISO": None
470
+ },
471
+ "br": {
472
+ "base": "Signal-non-understanding",
473
+ "ISO": "feedback"
474
+ },
475
+ "aap": {
476
+ "base": "Accept-part",
477
+ "ISO": None
478
+ },
479
+ "qh": {
480
+ "base": "Rhetorical-Question",
481
+ "ISO": "inform"
482
+ },
483
+ "tc": {
484
+ "base": "Topic Change",
485
+ "ISO": "discourse"
486
+ },
487
+ "r": {
488
+ "base": "Repeat",
489
+ "ISO": "inform"
490
+ },
491
+ "t1": {
492
+ "base": "Self-talk",
493
+ "ISO": None
494
+ },
495
+ "t3": {
496
+ "base": "3rd-party-talk",
497
+ "ISO": None
498
+ },
499
+ "bh": {
500
+ "base": "Rhetorical-question Continue",
501
+ "ISO": "propq"
502
+ },
503
+ "bsc": {
504
+ "base": "Reject-part",
505
+ "ISO": None
506
+ },
507
+ "arp": {
508
+ "base": "Misspeak Self-Correction",
509
+ "ISO": None
510
+ },
511
+ "bs": {
512
+ "base": "Reformulate/Summarize",
513
+ "ISO": "feedback"
514
+ },
515
+ "f": {
516
+ "base": "Follow Me",
517
+ "ISO": None
518
+ },
519
+ "qr": {
520
+ "base": "Or-Question",
521
+ "ISO": "choiceq"
522
+ },
523
+ "ft": {
524
+ "base": "Thanking",
525
+ "ISO": "thanking"
526
+ },
527
+ "g": {
528
+ "base": "Tag-Question",
529
+ "ISO": "propq"
530
+ },
531
+ "qo": {
532
+ "base": "Open-Question",
533
+ "ISO": None
534
+ },
535
+ "bc": {
536
+ "base": "Correct-misspeaking",
537
+ "ISO": None
538
+ },
539
+ "by": {
540
+ "base": "Sympathy",
541
+ "ISO": "apology"
542
+ },
543
+ "fw": {
544
+ "base": "Welcome",
545
+ "ISO": "thanking"
546
+ }
547
+ },
548
+ "swda": {
549
+ "sd": {
550
+ "base": "Statement-non-opinion",
551
+ "ISO": "inform"
552
+ },
553
+ "b": {
554
+ "base": "Acknowledge (Backchannel)",
555
+ "ISO": "feedback"
556
+ },
557
+ "sv": {
558
+ "base": "Statement-opinion",
559
+ "ISO": "inform"
560
+ },
561
+ "%": {
562
+ "base": "Uninterpretable",
563
+ "ISO": None
564
+ },
565
+ "aa": {
566
+ "base": "Agree/Accept",
567
+ "ISO": "agreement"
568
+ },
569
+ "ba": {
570
+ "base": "Appreciation",
571
+ "ISO": "feedback"
572
+ },
573
+ "qy": {
574
+ "base": "Yes-No-Question",
575
+ "ISO": "propq"
576
+ },
577
+ "ny": {
578
+ "base": "Yes Answers",
579
+ "ISO": "answer"
580
+ },
581
+ "fc": {
582
+ "base": "Conventional-closing",
583
+ "ISO": "discourse"
584
+ },
585
+ "qw": {
586
+ "base": "Wh-Question",
587
+ "ISO": "setq"
588
+ },
589
+ "nn": {
590
+ "base": "No Answers",
591
+ "ISO": "answer"
592
+ },
593
+ "bk": {
594
+ "base": "Response Acknowledgement",
595
+ "ISO": "feedback"
596
+ },
597
+ "h": {
598
+ "base": "Hedge",
599
+ "ISO": "answer"
600
+ },
601
+ "qy^d": {
602
+ "base": "Declarative Yes-No-Question",
603
+ "ISO": "propq"
604
+ },
605
+ "bh": {
606
+ "base": "Backchannel in Question Form",
607
+ "ISO": "propq"
608
+ },
609
+ "^q": {
610
+ "base": "Quotation",
611
+ "ISO": None
612
+ },
613
+ "bf": {
614
+ "base": "Summarize/Reformulate",
615
+ "ISO": "feedback"
616
+ },
617
+ "fo": {
618
+ "base": "Other forward-looking functions",
619
+ "ISO": "commissive"
620
+ },
621
+ "by": {
622
+ "base": "Sympathy",
623
+ "ISO": "apology"
624
+ },
625
+ "fw": {
626
+ "base": "Welcome",
627
+ "ISO": "thanking"
628
+ },
629
+ "o_\"_bc": {
630
+ "base": "Other",
631
+ "ISO": None
632
+ },
633
+ "na": {
634
+ "base": "Affirmative Non-yes Answers",
635
+ "ISO": "answer"
636
+ },
637
+ "ad": {
638
+ "base": "Action-directive",
639
+ "ISO": "directive"
640
+ },
641
+ "^2": {
642
+ "base": "Collaborative Completion",
643
+ "ISO": None
644
+ },
645
+ "b^m": {
646
+ "base": "Repeat-phrase",
647
+ "ISO": "feedback"
648
+ },
649
+ "qo": {
650
+ "base": "Open-Question",
651
+ "ISO": None
652
+ },
653
+ "qh": {
654
+ "base": "Rhetorical-Question",
655
+ "ISO": "inform"
656
+ },
657
+ "^h": {
658
+ "base": "Hold Before Answer/Agreement",
659
+ "ISO": "turn"
660
+ },
661
+ "ar": {
662
+ "base": "Reject",
663
+ "ISO": "disagreement"
664
+ },
665
+ "ng": {
666
+ "base": "Negative Non-no Answers",
667
+ "ISO": "answer"
668
+ },
669
+ "br": {
670
+ "base": "Signal-non-understanding",
671
+ "ISO": "feedback"
672
+ },
673
+ "no": {
674
+ "base": "Other Answers",
675
+ "ISO": "answer"
676
+ },
677
+ "fp": {
678
+ "base": "Conventional-opening",
679
+ "ISO": "discourse"
680
+ },
681
+ "qrr": {
682
+ "base": "Or-Clause",
683
+ "ISO": "choiceq"
684
+ },
685
+ "arp_nd": {
686
+ "base": "Dispreferred Answers",
687
+ "ISO": "answer"
688
+ },
689
+ "t3": {
690
+ "base": "3rd-party-talk",
691
+ "ISO": None
692
+ },
693
+ "oo": {
694
+ "base": "Offers",
695
+ "ISO": "directive"
696
+ },
697
+ "co_cc": {
698
+ "base": "Options Commits",
699
+ "ISO": "commissive"
700
+ },
701
+ "aap_am": {
702
+ "base": "Maybe/Accept-part",
703
+ "ISO": None
704
+ },
705
+ "t1": {
706
+ "base": "Downplayer",
707
+ "ISO": "apology"
708
+ },
709
+ "bd": {
710
+ "base": "Self-talk",
711
+ "ISO": None
712
+ },
713
+ "^g": {
714
+ "base": "Tag-Question",
715
+ "ISO": "propq"
716
+ },
717
+ "qw^d": {
718
+ "base": "Declarative Wh-Question",
719
+ "ISO": "setq"
720
+ },
721
+ "fa": {
722
+ "base": "Apology",
723
+ "ISO": "apology"
724
+ },
725
+ "ft": {
726
+ "base": "Thanking",
727
+ "ISO": "thanking"
728
+ }
729
+ },
730
+ "frames": {
731
+ "inform": {
732
+ "base": "Inform",
733
+ "ISO": "inform"
734
+ },
735
+ "sorry": {
736
+ "base": "Sorry",
737
+ "ISO": "apology"
738
+ },
739
+ "suggest": {
740
+ "base": "Suggest",
741
+ "ISO": "directive"
742
+ },
743
+ "negate": {
744
+ "base": "Negate",
745
+ "ISO": "disagreement"
746
+ },
747
+ "thankyou": {
748
+ "base": "Thank you",
749
+ "ISO": "thanking"
750
+ },
751
+ "greeting": {
752
+ "base": "Greeting",
753
+ "ISO": "greeting"
754
+ },
755
+ "request": {
756
+ "base": "Request",
757
+ "ISO": "directive"
758
+ },
759
+ "switch_frame": {
760
+ "base": "Switch Frame",
761
+ "ISO": None
762
+ },
763
+ "offer": {
764
+ "base": "Offer",
765
+ "ISO": "commissive"
766
+ },
767
+ "request_alts": {
768
+ "base": "Request Alternative",
769
+ "ISO": "directive"
770
+ },
771
+ "null": {
772
+ "base": "Other",
773
+ "ISO": None
774
+ },
775
+ "goodbye": {
776
+ "base": "Goodbye",
777
+ "ISO": "goodbye"
778
+ },
779
+ "moreinfo": {
780
+ "base": "Request More information",
781
+ "ISO": "directive"
782
+ },
783
+ "no_result": {
784
+ "base": "No Result",
785
+ "ISO": None
786
+ },
787
+ "affirm": {
788
+ "base": "Affirm",
789
+ "ISO": "answer"
790
+ },
791
+ "request_compare": {
792
+ "base": "Request Compare",
793
+ "ISO": "directive"
794
+ },
795
+ "confirm": {
796
+ "base": "Confirm",
797
+ "ISO": "answer"
798
+ },
799
+ "hearmore": {
800
+ "base": "Hear More",
801
+ "ISO": None
802
+ },
803
+ "canthelp": {
804
+ "base": "Can not help",
805
+ "ISO": None
806
+ },
807
+ "you_are_welcome": {
808
+ "base": "Welcome",
809
+ "ISO": "thanking"
810
+ },
811
+ "reject": {
812
+ "base": "Reject",
813
+ "ISO": "disagreement"
814
+ }
815
+ },
816
+ "dyda": {
817
+ "commissive": {
818
+ "base": "Commissive",
819
+ "ISO": "commissive"
820
+ },
821
+ "directive": {
822
+ "base": "Directive",
823
+ "ISO": "directive"
824
+ },
825
+ "inform": {
826
+ "base": "Inform",
827
+ "ISO": "inform"
828
+ },
829
+ "question": {
830
+ "base": "Question",
831
+ "ISO": None
832
+ }
833
+ },
834
+ "dstc3": {
835
+ "welcomemsg": {
836
+ "base": "Welcome",
837
+ "ISO": "thanking"
838
+ },
839
+ "inform": {
840
+ "base": "Inform",
841
+ "ISO": "inform"
842
+ },
843
+ "select": {
844
+ "base": "Select",
845
+ "ISO": None
846
+ },
847
+ "expl-conf": {
848
+ "base": "Explicit Confirmation",
849
+ "ISO": "answer"
850
+ },
851
+ "affirm": {
852
+ "base": "Affirmation",
853
+ "ISO": "answer"
854
+ },
855
+ "canthelp": {
856
+ "base": "Can not help",
857
+ "ISO": None
858
+ },
859
+ "request": {
860
+ "base": "Request",
861
+ "ISO": "directive"
862
+ },
863
+ "bye": {
864
+ "base": "Goodbye",
865
+ "ISO": "goodbye"
866
+ },
867
+ "offer": {
868
+ "base": "Offer",
869
+ "ISO": "commissive"
870
+ },
871
+ "thankyou": {
872
+ "base": "Thank you",
873
+ "ISO": "thanking"
874
+ },
875
+ "negate": {
876
+ "base": "Negate",
877
+ "ISO": "disagreement"
878
+ },
879
+ "null": {
880
+ "base": "Other",
881
+ "ISO": None
882
+ },
883
+ "reqalts": {
884
+ "base": "Request Alternative",
885
+ "ISO": "directive"
886
+ },
887
+ "canthelp.missing_slot_value": {
888
+ "base": "Can not help",
889
+ "ISO": None
890
+ },
891
+ "restart": {
892
+ "base": "Restart",
893
+ "ISO": None
894
+ },
895
+ "ack": {
896
+ "base": "Acknowledge",
897
+ "ISO": "feedback"
898
+ },
899
+ "reqmore": {
900
+ "base": "Request More",
901
+ "ISO": "directive"
902
+ },
903
+ "confirm": {
904
+ "base": "Confirm",
905
+ "ISO": "answer"
906
+ },
907
+ "hello": {
908
+ "base": "Hello",
909
+ "ISO": "greeting"
910
+ },
911
+ "repeat": {
912
+ "base": "Repeat",
913
+ "ISO": "inform"
914
+ },
915
+ "deny": {
916
+ "base": "Deny",
917
+ "ISO": "answer"
918
+ }
919
+ },
920
+ "dstc8-sgd": {
921
+ "INFORM": {
922
+ "base": "Inform",
923
+ "ISO": "inform"
924
+ },
925
+ "REQUEST": {
926
+ "base": "Request",
927
+ "ISO": "directive"
928
+ },
929
+ "CONFIRM": {
930
+ "base": "Confirm",
931
+ "ISO": "answer"
932
+ },
933
+ "AFFIRM": {
934
+ "base": "Affirmation",
935
+ "ISO": "answer"
936
+ },
937
+ "NOTIFY_FAILURE": {
938
+ "base": "Notify Failure",
939
+ "ISO": "inform"
940
+ },
941
+ "THANK_YOU": {
942
+ "base": "Thank you",
943
+ "ISO": "thanking"
944
+ },
945
+ "REQ_MORE": {
946
+ "base": "Request More",
947
+ "ISO": "directive"
948
+ },
949
+ "NEGATE": {
950
+ "base": "Negate",
951
+ "ISO": "disagreement"
952
+ },
953
+ "GOODBYE": {
954
+ "base": "Goodbye",
955
+ "ISO": "goodbye"
956
+ },
957
+ "NOTIFY_SUCCESS": {
958
+ "base": "Notify Success",
959
+ "ISO": "inform"
960
+ },
961
+ "INFORM_INTENT": {
962
+ "base": "Inform Intention",
963
+ "ISO": "commissive"
964
+ },
965
+ "OFFER": {
966
+ "base": "Offer",
967
+ "ISO": "commissive"
968
+ },
969
+ "SELECT": {
970
+ "base": "Select",
971
+ "ISO": None
972
+ },
973
+ "OFFER_INTENT": {
974
+ "base": "Offer Intent",
975
+ "ISO": "commissive"
976
+ },
977
+ "NEGATE_INTENT": {
978
+ "base": "Negate Intent",
979
+ "ISO": "disagreement"
980
+ },
981
+ "REQUEST_ALTS": {
982
+ "base": "Request Alternatives",
983
+ "ISO": "directive"
984
+ },
985
+ "AFFIRM_INTENT": {
986
+ "base": "Affirm Intent",
987
+ "ISO": "answer"
988
+ }
989
+ }
990
+ }
991
 
992
  class DAISOConfig(datasets.BuilderConfig):
993
  """BuilderConfig for DAISO."""
994
 
995
+ def __init__(self, label_classes, features, data_url, citation, url, **kwargs):
996
  """BuilderConfig for DAISO.
997
  Args:
998
  features: `list[string]`, list of the features that will appear in the
 
1029
  # data = datasets.load_dataset('my_dataset', 'first_domain')
1030
  # data = datasets.load_dataset('my_dataset', 'second_domain')
1031
  BUILDER_CONFIGS = [
1032
+ DAISOConfig(
1033
+ name="ami",
1034
+ description=textwrap.dedent(
1035
+ """\
1036
+ """
1037
+ ),
1038
+ label_classes=LABELS_MAPPING["ami"],
1039
+ features=[
1040
+ ],
1041
+ data_url={
1042
+ "train": _URL + "/ami/train.csv",
1043
+ "test": _URL + "/ami/test.csv",
1044
+ },
1045
+ citation=textwrap.dedent(
1046
+ """"""
1047
+ ),
1048
+ url="",
1049
+ ),
1050
+ DAISOConfig(
1051
+ name="oasis",
1052
+ description=textwrap.dedent(
1053
+ """\
1054
+ """
1055
+ ),
1056
+ label_classes=LABELS_MAPPING["oasis"],
1057
+ features=[
1058
+ ],
1059
+ data_url={
1060
+ "train": _URL + "/oasis/train.csv",
1061
+ "dev": _URL + "/oasis/dev.csv",
1062
+ "test": _URL + "/oasis/test.csv",
1063
+ },
1064
+ citation=textwrap.dedent(
1065
+ """"""
1066
+ ),
1067
+ url="",
1068
+ ),
1069
+ DAISOConfig(
1070
+ name="maptask",
1071
+ description=textwrap.dedent(
1072
+ """\
1073
+ """
1074
+ ),
1075
+ label_classes=LABELS_MAPPING["maptask"],
1076
+ features=[
1077
+ ],
1078
+ data_url={
1079
+ "train": _URL + "/maptask/train.csv",
1080
+ "dev": _URL + "/maptask/dev.csv",
1081
+ "test": _URL + "/maptask/test.csv",
1082
+ },
1083
+ citation=textwrap.dedent(
1084
+ """"""
1085
+ ),
1086
+ url="",
1087
+ ),
1088
+ DAISOConfig(
1089
+ name="mrda",
1090
+ description=textwrap.dedent(
1091
+ """\
1092
+ """
1093
+ ),
1094
+ label_classes=LABELS_MAPPING["mrda"],
1095
+ features=[
1096
+ ],
1097
+ data_url={
1098
+ "train": _URL + "/mrda/train.csv",
1099
+ "dev": _URL + "/mrda/dev.csv",
1100
+ "test": _URL + "/mrda/test.csv",
1101
+ },
1102
+ citation=textwrap.dedent(
1103
+ """"""
1104
+ ),
1105
+ url="",
1106
+ ),
1107
+ DAISOConfig(
1108
+ name="swda",
1109
+ description=textwrap.dedent(
1110
+ """\
1111
+ """
1112
+ ),
1113
+ label_classes=LABELS_MAPPING["swda"],
1114
+ features=[
1115
+ ],
1116
+ data_url={
1117
+ "train": _URL + "/swda/train.csv",
1118
+ "dev": _URL + "/swda/dev.csv",
1119
+ "test": _URL + "/swda/test.csv",
1120
+ },
1121
+ citation=textwrap.dedent(
1122
+ """"""
1123
+ ),
1124
+ url="",
1125
+ ),
1126
+ DAISOConfig(
1127
+ name="frames",
1128
+ description=textwrap.dedent(
1129
+ """\
1130
+ """
1131
+ ),
1132
+ label_classes=LABELS_MAPPING["frames"],
1133
+ features=[
1134
+ ],
1135
+ data_url={
1136
+ "train": _URL + "/frames/train.csv",
1137
+ "test": _URL + "/frames/test.csv",
1138
+ },
1139
+ citation=textwrap.dedent(
1140
+ """"""
1141
+ ),
1142
+ url="",
1143
+ ),
1144
  DAISOConfig(
1145
  name="dyda",
1146
  description=textwrap.dedent(
1147
  """\
1148
  """
1149
  ),
1150
+ label_classes=LABELS_MAPPING["dyda"],
1151
+ # {"commissive": {
1152
+ # "base": "Commissive",
1153
+ # "ISO": "commissive"
1154
+ # },
1155
+ # "directive": {
1156
+ # "base": "Directive",
1157
+ # "ISO": "directive"
1158
+ # },
1159
+ # "inform": {
1160
+ # "base": "Inform",
1161
+ # "ISO": "inform"
1162
+ # },
1163
+ # "question": {
1164
+ # "base": "Question",
1165
+ # "ISO": None
1166
+ # }
1167
+ # },
1168
  features=[
1169
  "Utterance",
1170
  "Dialogue_Act",
 
1187
  }"""
1188
  ),
1189
  url="http://yanran.li/dailydialog.html",
1190
+ ),
1191
+ DAISOConfig(
1192
+ name="dstc3",
1193
+ description=textwrap.dedent(
1194
+ """\
1195
+ """
1196
+ ),
1197
+ label_classes=LABELS_MAPPING["dstc3"],
1198
+ features=[
1199
+ ],
1200
+ data_url={
1201
+ "train": _URL + "/dstc3/train.csv",
1202
+ "test": _URL + "/dstc3/test.csv",
1203
+ },
1204
+ citation=textwrap.dedent(
1205
+ """"""
1206
+ ),
1207
+ url="",
1208
+ ),
1209
+ DAISOConfig(
1210
+ name="dstc8-sgd",
1211
+ description=textwrap.dedent(
1212
+ """\
1213
+ """
1214
+ ),
1215
+ label_classes=LABELS_MAPPING["dstc8-sgd"],
1216
+ features=[
1217
+ ],
1218
+ data_url={
1219
+ "train": _URL + "/dstc8-sgd/train.csv",
1220
+ "dev": _URL + "/dstc8-sgd/dev.csv",
1221
+ "test": _URL + "/dstc8-sgd/test.csv",
1222
+ },
1223
+ citation=textwrap.dedent(
1224
+ """"""
1225
+ ),
1226
+ url="",
1227
+ ),
1228
+
1229
  ]
1230
 
1231
  DEFAULT_CONFIG_NAME = "dyda" # It's not mandatory to have a default configuration. Just use one if it make sense.
 
1235
  features = {feature: datasets.Value("string") for feature in self.config.features}
1236
  if self.config.label_classes:
1237
  features["Label"] = datasets.features.ClassLabel(names=list(self.config.label_classes.keys()))
1238
+ features["Label_ISO"] = datasets.features.ClassLabel(
1239
+ names=[map.get("ISO") for map in self.config.label_classes.values()])
1240
  features["Idx"] = datasets.Value("int32")
1241
  # if self.config.name == "": # This is the name of the configuration selected in BUILDER_CONFIGS above
1242
  # features = datasets.Features(