This view is limited to 50 files because it contains too many changes.  See the raw diff here.
Files changed (50) hide show
  1. README.md +1 -203
  2. data/.gitattributes +0 -7
  3. data/{slue-hvb.zip → slue-hvb_blind.zip} +2 -2
  4. data/{slue-sqa5.zip → slue-sqa5_blind.zip} +2 -2
  5. data/slue-ted_dev.zip +2 -2
  6. data/slue-ted_test.zip +0 -3
  7. hvb/test-00000-of-00001.parquet → data/slue-ted_test_blind.zip +2 -2
  8. data/slue-ted_train.zip +2 -2
  9. data/{slue-vp_nel.zip → slue-vp_nel_blind.zip} +2 -2
  10. hvb/train-00000-of-00002.parquet +0 -3
  11. hvb/train-00001-of-00002.parquet +0 -3
  12. hvb/validation-00000-of-00001.parquet +0 -3
  13. slue-phase-2.py +454 -0
  14. sqa5/test-00000-of-00014.parquet +0 -3
  15. sqa5/test-00001-of-00014.parquet +0 -3
  16. sqa5/test-00002-of-00014.parquet +0 -3
  17. sqa5/test-00003-of-00014.parquet +0 -3
  18. sqa5/test-00004-of-00014.parquet +0 -3
  19. sqa5/test-00005-of-00014.parquet +0 -3
  20. sqa5/test-00006-of-00014.parquet +0 -3
  21. sqa5/test-00007-of-00014.parquet +0 -3
  22. sqa5/test-00008-of-00014.parquet +0 -3
  23. sqa5/test-00009-of-00014.parquet +0 -3
  24. sqa5/test-00010-of-00014.parquet +0 -3
  25. sqa5/test-00011-of-00014.parquet +0 -3
  26. sqa5/test-00012-of-00014.parquet +0 -3
  27. sqa5/test-00013-of-00014.parquet +0 -3
  28. sqa5/train-00000-of-00270.parquet +0 -3
  29. sqa5/train-00001-of-00270.parquet +0 -3
  30. sqa5/train-00002-of-00270.parquet +0 -3
  31. sqa5/train-00003-of-00270.parquet +0 -3
  32. sqa5/train-00004-of-00270.parquet +0 -3
  33. sqa5/train-00005-of-00270.parquet +0 -3
  34. sqa5/train-00006-of-00270.parquet +0 -3
  35. sqa5/train-00007-of-00270.parquet +0 -3
  36. sqa5/train-00008-of-00270.parquet +0 -3
  37. sqa5/train-00009-of-00270.parquet +0 -3
  38. sqa5/train-00010-of-00270.parquet +0 -3
  39. sqa5/train-00011-of-00270.parquet +0 -3
  40. sqa5/train-00012-of-00270.parquet +0 -3
  41. sqa5/train-00013-of-00270.parquet +0 -3
  42. sqa5/train-00014-of-00270.parquet +0 -3
  43. sqa5/train-00015-of-00270.parquet +0 -3
  44. sqa5/train-00016-of-00270.parquet +0 -3
  45. sqa5/train-00017-of-00270.parquet +0 -3
  46. sqa5/train-00018-of-00270.parquet +0 -3
  47. sqa5/train-00019-of-00270.parquet +0 -3
  48. sqa5/train-00020-of-00270.parquet +0 -3
  49. sqa5/train-00021-of-00270.parquet +0 -3
  50. sqa5/train-00022-of-00270.parquet +0 -3
README.md CHANGED
@@ -1,212 +1,10 @@
1
- ---
2
- dataset_info:
3
- - config_name: hvb
4
- features:
5
- - name: issue_id
6
- dtype: string
7
- - name: audio
8
- dtype:
9
- audio:
10
- sampling_rate: 16000
11
- - name: speaker_id
12
- dtype: string
13
- - name: text
14
- dtype: string
15
- - name: utt_index
16
- dtype: int32
17
- - name: channel
18
- dtype: int32
19
- - name: role
20
- dtype: string
21
- - name: start_ms
22
- dtype: int32
23
- - name: duration_ms
24
- dtype: int32
25
- - name: intent
26
- dtype: string
27
- - name: dialog_acts
28
- sequence: string
29
- splits:
30
- - name: train
31
- num_bytes: 803631533.648
32
- num_examples: 11344
33
- - name: validation
34
- num_bytes: 115999281.63
35
- num_examples: 1690
36
- - name: test
37
- num_bytes: 413280185.739
38
- num_examples: 6121
39
- download_size: 1287263357
40
- dataset_size: 1332911001.017
41
- - config_name: sqa5
42
- features:
43
- - name: question_id
44
- dtype: string
45
- - name: question_audio
46
- dtype:
47
- audio:
48
- sampling_rate: 16000
49
- - name: question_speaker_id
50
- dtype: string
51
- - name: raw_question_text
52
- dtype: string
53
- - name: normalized_question_text
54
- dtype: string
55
- - name: document_id
56
- dtype: string
57
- - name: document_audio
58
- dtype:
59
- audio:
60
- sampling_rate: 16000
61
- - name: document_speaker_id
62
- dtype: string
63
- - name: raw_document_text
64
- dtype: string
65
- - name: normalized_document_text
66
- dtype: string
67
- - name: word2time
68
- sequence:
69
- - name: word
70
- dtype: string
71
- - name: normalized_word
72
- dtype: string
73
- - name: start_second
74
- dtype: float64
75
- - name: end_second
76
- dtype: float64
77
- - name: answer_spans
78
- sequence:
79
- - name: answer
80
- dtype: string
81
- - name: start_second
82
- dtype: float64
83
- - name: end_second
84
- dtype: float64
85
- splits:
86
- - name: train
87
- num_bytes: 134775904845.04
88
- num_examples: 46186
89
- - name: validation
90
- num_bytes: 5686714785.843
91
- num_examples: 1939
92
- - name: test
93
- num_bytes: 6967375359.628
94
- num_examples: 2382
95
- - name: verified_test
96
- num_bytes: 1182628989.0
97
- num_examples: 408
98
- download_size: 118074473123
99
- dataset_size: 148612623979.511
100
- - config_name: ted
101
- features:
102
- - name: id
103
- dtype: string
104
- - name: audio
105
- dtype:
106
- audio:
107
- sampling_rate: 16000
108
- - name: speaker
109
- dtype: string
110
- - name: transcript
111
- dtype: string
112
- - name: title
113
- dtype: string
114
- - name: abstract
115
- dtype: string
116
- splits:
117
- - name: train
118
- num_bytes: 46573026086.984
119
- num_examples: 3384
120
- - name: validation
121
- num_bytes: 5694199931.0
122
- num_examples: 425
123
- - name: test
124
- num_bytes: 5959094411.0
125
- num_examples: 423
126
- download_size: 58384489268
127
- dataset_size: 58226320428.984
128
- - config_name: vp_nel
129
- features:
130
- - name: id
131
- dtype: string
132
- - name: audio
133
- dtype:
134
- audio:
135
- sampling_rate: 16000
136
- - name: speaker_id
137
- dtype: string
138
- - name: text
139
- dtype: string
140
- - name: word_timestamps
141
- sequence:
142
- - name: word
143
- dtype: string
144
- - name: start_sec
145
- dtype: float64
146
- - name: end_sec
147
- dtype: float64
148
- - name: ne_timestamps
149
- sequence:
150
- - name: ne_label
151
- dtype: string
152
- - name: start_char_idx
153
- dtype: int32
154
- - name: char_offset
155
- dtype: int32
156
- - name: start_sec
157
- dtype: float64
158
- - name: end_sec
159
- dtype: float64
160
- splits:
161
- - name: validation
162
- num_bytes: 83371882.75
163
- num_examples: 1750
164
- - name: test
165
- num_bytes: 85222143.142
166
- num_examples: 1838
167
- download_size: 165119242
168
- dataset_size: 168594025.89200002
169
- configs:
170
- - config_name: hvb
171
- data_files:
172
- - split: train
173
- path: hvb/train-*
174
- - split: validation
175
- path: hvb/validation-*
176
- - split: test
177
- path: hvb/test-*
178
- - config_name: sqa5
179
- data_files:
180
- - split: train
181
- path: sqa5/train-*
182
- - split: validation
183
- path: sqa5/validation-*
184
- - split: test
185
- path: sqa5/test-*
186
- - split: verified_test
187
- path: sqa5/verified_test-*
188
- - config_name: ted
189
- data_files:
190
- - split: train
191
- path: ted/train-*
192
- - split: validation
193
- path: ted/validation-*
194
- - split: test
195
- path: ted/test-*
196
- - config_name: vp_nel
197
- data_files:
198
- - split: validation
199
- path: vp_nel/validation-*
200
- - split: test
201
- path: vp_nel/test-*
202
- ---
203
 
204
 
205
 
206
  ### Dataset description
207
 
 
208
 
209
- - **(Jan. 8 2024) Test set labels are released**
210
  - **Toolkit Repository:** [https://github.com/asappresearch/slue-toolkit/](https://github.com/asappresearch/slue-toolkit/)
211
  - **Paper:** [https://arxiv.org/abs/2212.10525](https://arxiv.org/abs/2212.10525)
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
 
3
 
4
  ### Dataset description
5
 
6
+ **(Jul. 11 2023) Detail information will released soon.**
7
 
 
8
  - **Toolkit Repository:** [https://github.com/asappresearch/slue-toolkit/](https://github.com/asappresearch/slue-toolkit/)
9
  - **Paper:** [https://arxiv.org/abs/2212.10525](https://arxiv.org/abs/2212.10525)
10
 
data/.gitattributes DELETED
@@ -1,7 +0,0 @@
1
- slue-sqa5_blind.zip filter=lfs diff=lfs merge=lfs -text
2
- slue-ted_dev.zip filter=lfs diff=lfs merge=lfs -text
3
- slue-ted_test_blind.zip filter=lfs diff=lfs merge=lfs -text
4
- slue-ted_test.zip filter=lfs diff=lfs merge=lfs -text
5
- slue-ted_train.zip filter=lfs diff=lfs merge=lfs -text
6
- slue-vp_nel_blind.zip filter=lfs diff=lfs merge=lfs -text
7
- slue-hvb_blind.zip filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
data/{slue-hvb.zip → slue-hvb_blind.zip} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7602ceb8fb8c5badc9af9916ba5e25c001f58492b218c6919153682f5a277414
3
- size 1086778430
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ff9e431f9bb3ee94c154bcabd9c116542bff4b505483ab1150827d2e53d17dd
3
+ size 1086661033
data/{slue-sqa5.zip → slue-sqa5_blind.zip} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8504ffb20b479cbb74aa34acbb17596b4f89ddd42af685f42ccd8cf2fe974fc5
3
- size 43389086505
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6937e1a9a272deb055e837eb1f38c30619131967cb4ca1f051d0ca01a7a492b9
3
+ size 43387944845
data/slue-ted_dev.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:75c5003d31500b763822e58112855d682342164a07e6ada7dc68d2c742f28b3f
3
- size 5692021060
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5c679d3c9dcdd20ea90b1ee0a57d8d176e31264e9499d35f7013f624ac93c02
3
+ size 5692022240
data/slue-ted_test.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a84652075b35f32f1071cb0f1f2ebb0edc6cab5d269d066e0ded363610bbd27f
3
- size 5968290513
 
 
 
 
hvb/test-00000-of-00001.parquet → data/slue-ted_test_blind.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:efea92223f34b74d1b02b3472bd0f131cbf853472c9e548f86b2434fcbf44e68
3
- size 407246973
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33fbdad35f0557ce9cb0ce12abf1c20f8c9851d271b689d1b787b6ec072292c4
3
+ size 5972328793
data/slue-ted_train.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:52d0bfef38486d090296f800a1bd9f8fc511825d7c350c0700084a1c68f44cf9
3
- size 46727682232
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b17e2c27e8ceac6b7ede9ba639833130710337515265dedd35f66e0aff2b670e
3
+ size 46727678707
data/{slue-vp_nel.zip → slue-vp_nel_blind.zip} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6d51bb4e73b5d8c9b44cf3a2d23e28bb3066163260a3e6726b6ed33c0b819e94
3
- size 168703692
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62a1fd6d01a19a08042bd7e1ae8549c08db67001cecf0fd43c96d4da3154e1d7
3
+ size 168568066
hvb/train-00000-of-00002.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5a44a37a283f00550d9c2c73af5d9d1ab407e7a8df3f0d7fff024208fa208994
3
- size 382885481
 
 
 
 
hvb/train-00001-of-00002.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ac085b2455cf4e91fdf1f6fbfc3489a3d7bb4c2f329e282ba8473117241e3033
3
- size 386784369
 
 
 
 
hvb/validation-00000-of-00001.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:562359e1b6c695123c6f909eb96a916322462d4fdcca6396b5bf8b5d286d1765
3
- size 110346534
 
 
 
 
slue-phase-2.py ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import List
2
+ import os
3
+ import csv
4
+ import ast
5
+ import gzip
6
+ import json
7
+
8
+ import datasets
9
+ from datasets.utils.logging import get_logger
10
+
11
+ logger = get_logger(__name__)
12
+
13
+ _URL = "https://asappresearch.github.io/slue-toolkit/"
14
+
15
+ _DL_URLS = {
16
+ "slue-hvb": "data/slue-hvb_blind.zip",
17
+ "slue-sqa5": "data/slue-sqa5_blind.zip",
18
+ "slue-vp_nel": "data/slue-vp_nel_blind.zip",
19
+ "slue-ted": "data/slue-ted",
20
+ }
21
+
22
+ _LICENSE = """
23
+ =======================================================
24
+ The license of this script
25
+ MIT License
26
+ Copyright (c) 2023 ASAPP Inc.
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+ The above copyright notice and this permission notice shall be included in all
34
+ copies or substantial portions of the Software.
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ SOFTWARE.
42
+ =======================================================
43
+ SLUE-HVB dataset contains a subset of the Gridspace-Stanford Harper Valley speech dataset and the copyright of this subset remains the same with the original license, CC-BY-4.0. See also original license notice (https://github.com/cricketclub/gridspace-stanford-harper-valley/blob/master/LICENSE)
44
+
45
+ Additionally, we provide dialog act classification annotation and it is covered with the same license as CC-BY-4.0.
46
+ =======================================================
47
+ SLUE-SQA-5 Dataset
48
+
49
+ SLUE-SQA-5 Dataset contains question texts and answer strings (question_text, normalized_question_text, and answer_spans column in .tsv files) from these datasets,
50
+ * SQuAD1.1 (for questions whose question_id starts with ‘squad-’)
51
+ * Natural Questions (for questions whose question_id starts with ‘nq-’)
52
+ * WebQuestions (for questions whose question_id starts with ‘wq-’)
53
+ * CuratedTREC (for questions whose question_id starts with ‘trec-’)
54
+ * TriviaQA (for questions whose question_id starts with ‘triviaqa-’)
55
+ Additionally, we provide audio recordings (.wav files in “question” directories) of these questions.
56
+
57
+ For questions from TriviaQA (questions whose question_id starts with ‘triviaqa-’), their question texts, answer strings, and audio recordings are licensed with the same Apache License 2.0 as TriviaQA (for more detail, please refer to https://github.com/mandarjoshi90/triviaqa/blob/master/LICENSE).
58
+ For questions from the other 4 datasets, their question texts, answer strings, and audio recordings are licensed with Creative Commons Attribution-ShareAlike 4.0 International license.
59
+
60
+ SLUE-SQA-5 also contains a subset of Spoken Wikipedia, including the audios placed in “document” directories and their transcripts (document_text and normalized_document_text column in .tsv files). Additionally, we provide the text-to-speech alignments (.txt files in “word2time” directories).These contents are licensed with the same Creative Commons (CC BY-SA 4.0) license as Spoken Wikipedia.
61
+ =======================================================
62
+ SLUE-vp_nel Dataset
63
+
64
+ SLUE-vp_nel includes word-level time stamps for dev and test splits of the SLUE-voxpopuli corpus.
65
+ For the dev split, the dataset also contains named entity annotations and corresponding time-stamps in a tsv format.
66
+ =======================================================
67
+ SLUE-TED Dataset
68
+
69
+ SLUE-TED Dataset contains TED Talk audios along with the associated abstracts and title, which were concatenated to create reference summaries. This corpus is licensed with the same Creative Commons (CC BY–NC–ND 4.0 International) license as TED talks. For further information, please refer to the details provided below.
70
+ =======================================================
71
+ """
72
+
73
+ _CITATION = """\
74
+ @inproceedings{shon2023slue_phase2,
75
+ title={SLUE Phase-2: A Benchmark Suite of Diverse Spoken Language Understanding Tasks},
76
+ author={Shon, Suwon and Arora, Siddhant and Lin, Chyi-Jiunn and Pasad, Ankita and Wu, Felix and Sharma, Roshan and Wu, Wei-Lun and Lee, Hung-Yi and Livescu, Karen and Watanabe, Shinji},
77
+ booktitle={ACL},
78
+ year={2023},
79
+ }
80
+ """
81
+
82
+ _DESCRIPTION = """\
83
+ Spoken Language Understanding Evaluation (SLUE) benchmark Phase 2.
84
+ """
85
+
86
+ def parse_qa_answer_spans(answer_spans):
87
+ answer_spans = ast.literal_eval(answer_spans)
88
+ return [{"answer": a, "start_second": s, "end_second": e} for a, s, e in answer_spans]
89
+
90
+ def load_word2time(word2time_file):
91
+ word2time = []
92
+ with open(word2time_file, "r") as f:
93
+ for line in f.readlines():
94
+ entity = line.strip().split('\t')
95
+ if len(entity)==1:
96
+ word = entity[0]
97
+ normalized_word, start_sec, end_sec = "", -1.0, -1.0
98
+ else:
99
+ word, normalized_word, start_sec, end_sec = entity
100
+ start_sec, end_sec = float(start_sec), float(end_sec)
101
+ word2time.append(
102
+ {
103
+ "word": word,
104
+ "normalized_word": normalized_word,
105
+ "start_second": start_sec,
106
+ "end_second": end_sec,
107
+ }
108
+ )
109
+ return word2time
110
+
111
+ def parse_nel_time_spans(nel_timestamps):
112
+ nel_timestamps = ast.literal_eval(nel_timestamps)
113
+ if nel_timestamps is None:
114
+ return []
115
+ return [
116
+ {
117
+ "ne_label": ne,
118
+ "start_char_idx": start,
119
+ "char_offset": off,
120
+ "start_sec": t0,
121
+ "end_sec": t1,
122
+ }
123
+ for ne, start, off, t0, t1 in nel_timestamps
124
+ ]
125
+
126
+ def read_word_timestamps(word_alignments_fn):
127
+ data = json.loads(open(word_alignments_fn).read())
128
+ return [
129
+ {"word": word, "start_sec": start, "end_sec": end}
130
+ for word, start, end in data["timestamps"]
131
+ ]
132
+
133
+ class SLUE2Config(datasets.BuilderConfig):
134
+ """BuilderConfig for SLUE."""
135
+
136
+ def __init__(self, **kwargs):
137
+ """
138
+ Args:
139
+ data_dir: `string`, the path to the folder containing the files in the
140
+ downloaded .tar
141
+ citation: `string`, citation for the data set
142
+ url: `string`, url for information about the data set
143
+ **kwargs: keyword arguments forwarded to super.
144
+ """
145
+ super(SLUE2Config, self).__init__(
146
+ version=datasets.Version("2.4.0", ""), **kwargs
147
+ )
148
+
149
+
150
+ class SLUE2(datasets.GeneratorBasedBuilder):
151
+ """Librispeech dataset."""
152
+
153
+ DEFAULT_WRITER_BATCH_SIZE = 256
154
+ DEFAULT_CONFIG_NAME = "hvb"
155
+ BUILDER_CONFIGS = [
156
+ SLUE2Config(
157
+ name="hvb",
158
+ description="SLUE-HVB set.",
159
+ ),
160
+ SLUE2Config(
161
+ name="sqa5",
162
+ description="SLUE-SQA-5 set which includes Spoken Question Answering task.",
163
+ ),
164
+ SLUE2Config(
165
+ name="vp_nel",
166
+ description="SLUE-vp_nel set with named entity labels and time-stamps.",
167
+ ),
168
+ SLUE2Config(
169
+ name="ted",
170
+ description="SLUE-TED set which includes Speech Summarisation task",
171
+ ),
172
+ ]
173
+
174
+ def _info(self):
175
+ if self.config.name == "hvb":
176
+ features = {
177
+ "issue_id": datasets.Value("string"),
178
+ "audio": datasets.Audio(sampling_rate=16_000),
179
+ "speaker_id": datasets.Value("string"),
180
+ "text": datasets.Value("string"),
181
+ "utt_index": datasets.Value("int32"),
182
+ "channel": datasets.Value("int32"),
183
+ "role": datasets.Value("string"),
184
+ "start_ms": datasets.Value("int32"),
185
+ "duration_ms": datasets.Value("int32"),
186
+ "intent": datasets.Value("string"),
187
+ "dialog_acts": datasets.Sequence(
188
+ datasets.Value("string"),
189
+ ),
190
+ }
191
+ elif self.config.name == "sqa5":
192
+ features = {
193
+ "question_id": datasets.Value("string"),
194
+ "question_audio": datasets.Audio(sampling_rate=16_000),
195
+ "question_speaker_id": datasets.Value("string"),
196
+ "raw_question_text": datasets.Value("string"),
197
+ "normalized_question_text": datasets.Value("string"),
198
+ "document_id": datasets.Value("string"),
199
+ "document_audio": datasets.Audio(sampling_rate=16_000),
200
+ "document_speaker_id": datasets.Value("string"),
201
+ "raw_document_text": datasets.Value("string"),
202
+ "normalized_document_text": datasets.Value("string"),
203
+ "word2time": datasets.Sequence(
204
+ {
205
+ "word": datasets.Value("string"),
206
+ "normalized_word": datasets.Value("string"),
207
+ "start_second": datasets.Value("float64"),
208
+ "end_second": datasets.Value("float64"),
209
+ }
210
+ ),
211
+ "answer_spans": datasets.Sequence(
212
+ {
213
+ "answer": datasets.Value("string"),
214
+ "start_second": datasets.Value("float64"),
215
+ "end_second": datasets.Value("float64"),
216
+ }
217
+ ),
218
+ }
219
+ elif self.config.name == "vp_nel":
220
+ features = {
221
+ "id": datasets.Value("string"),
222
+ "audio": datasets.Audio(sampling_rate=16_000),
223
+ "speaker_id": datasets.Value("string"),
224
+ "text": datasets.Value("string"),
225
+ "word_timestamps": datasets.Sequence(
226
+ {
227
+ "word": datasets.Value("string"),
228
+ "start_sec": datasets.Value("float64"),
229
+ "end_sec": datasets.Value("float64"),
230
+ }
231
+ ),
232
+ "ne_timestamps": datasets.Sequence(
233
+ {
234
+ "ne_label": datasets.Value("string"),
235
+ "start_char_idx": datasets.Value("int32"),
236
+ "char_offset": datasets.Value("int32"),
237
+ "start_sec": datasets.Value("float64"),
238
+ "end_sec": datasets.Value("float64"),
239
+ }
240
+ ),
241
+ }
242
+ elif self.config.name == "ted":
243
+ features = {
244
+ "id": datasets.Value("string"),
245
+ "audio": datasets.Audio(sampling_rate=16_000),
246
+ "speaker": datasets.Value("string"),
247
+ "transcript": datasets.Value("string"),
248
+ "title": datasets.Value("string"),
249
+ "abstract": datasets.Value("string"),
250
+ }
251
+ return datasets.DatasetInfo(
252
+ description=_DESCRIPTION,
253
+ features=datasets.Features(features),
254
+ supervised_keys=("file", "text"),
255
+ homepage=_URL,
256
+ citation=_CITATION,
257
+ license=_LICENSE,
258
+ )
259
+
260
+ def _split_generators(
261
+ self, dl_manager: datasets.DownloadManager
262
+ ) -> List[datasets.SplitGenerator]:
263
+
264
+ config_name = f"slue-{self.config.name}"
265
+ if config_name=="slue-ted":
266
+ train_dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name]+"_train.zip")
267
+ valid_dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name]+"_dev.zip")
268
+ test_dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name]+"_test_blind.zip")
269
+ else:
270
+ dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name])
271
+ data_dir = os.path.join(dl_dir, config_name)
272
+
273
+ splits = []
274
+ if self.config.name in ["hvb", "sqa5"]:
275
+ splits.append(
276
+ datasets.SplitGenerator(
277
+ name=datasets.Split.TRAIN,
278
+ gen_kwargs={
279
+ "filepath": os.path.join(
280
+ data_dir or "", f"{config_name}_fine-tune.tsv"
281
+ ),
282
+ "data_dir": data_dir,
283
+ },
284
+ )
285
+ )
286
+ if self.config.name in ["ted"]:
287
+ splits.append(
288
+ datasets.SplitGenerator(
289
+ name=datasets.Split.TRAIN,
290
+ gen_kwargs={
291
+ "filepath": os.path.join(
292
+ os.path.join(train_dl_dir, config_name) or "", f"{config_name}_fine-tune.tsv"
293
+ ),
294
+ "data_dir": os.path.join(train_dl_dir, config_name),
295
+ },
296
+ )
297
+ )
298
+ splits.append(
299
+ datasets.SplitGenerator(
300
+ name=datasets.Split.VALIDATION,
301
+ gen_kwargs={
302
+ "filepath": os.path.join(
303
+ os.path.join(valid_dl_dir, config_name+"_dev") or "", f"{config_name}_dev.tsv"
304
+ ),
305
+ "data_dir": os.path.join(valid_dl_dir, config_name+"_dev"),
306
+ },
307
+ ),
308
+ )
309
+ splits.append(
310
+ datasets.SplitGenerator(
311
+ name=datasets.Split.TEST,
312
+ gen_kwargs={
313
+ "filepath": os.path.join(
314
+ os.path.join(test_dl_dir, config_name+"_test") or "", f"{config_name}_test_blind.tsv"
315
+ ),
316
+ "data_dir": os.path.join(test_dl_dir, config_name+"_test"),
317
+ },
318
+ ),
319
+ )
320
+ if self.config.name in ["hvb", "sqa5", "vp_nel"]:
321
+ splits.append(
322
+ datasets.SplitGenerator(
323
+ name=datasets.Split.VALIDATION,
324
+ gen_kwargs={
325
+ "filepath": os.path.join(
326
+ data_dir or "", f"{config_name}_dev.tsv"
327
+ ),
328
+ "data_dir": data_dir,
329
+ },
330
+ ),
331
+ )
332
+ splits.append(
333
+ datasets.SplitGenerator(
334
+ name=datasets.Split.TEST,
335
+ gen_kwargs={
336
+ "filepath": os.path.join(
337
+ data_dir or "", f"{config_name}_test_blind.tsv"
338
+ ),
339
+ "data_dir": data_dir,
340
+ },
341
+ ),
342
+ )
343
+ if self.config.name == "sqa5":
344
+ splits.append(
345
+ datasets.SplitGenerator(
346
+ name="verified_test",
347
+ gen_kwargs={
348
+ "filepath": os.path.join(
349
+ data_dir or "", f"{config_name}_verified-test_blind.tsv"
350
+ ),
351
+ "data_dir": data_dir,
352
+ },
353
+ )
354
+ )
355
+ return splits
356
+
357
+ def _generate_examples(self, filepath, data_dir):
358
+ logger.info(f"generating examples from = {filepath}")
359
+
360
+ with open(filepath) as f:
361
+ if self.config.name == "sqa5":
362
+ reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
363
+ else:
364
+ reader = csv.DictReader(f, delimiter="\t")
365
+
366
+ for idx, row in enumerate(reader):
367
+ if self.config.name == "hvb":
368
+ split = "test" if "test" in filepath else "dev" if "dev" in filepath else "fine-tune"
369
+ audio_file = os.path.join(
370
+ data_dir, split,
371
+ f'{row["issue_id"]}_{row["start_ms"]}_{int(row["start_ms"]) + int(row["duration_ms"])}.wav'
372
+ )
373
+ example = {
374
+ "issue_id": row["issue_id"],
375
+ "audio": audio_file,
376
+ "speaker_id": row["speaker_id"],
377
+ "text": row["text"],
378
+ "utt_index": int(row["utt_index"]),
379
+ "channel": int(row["channel"]),
380
+ "role": row["role"],
381
+ "start_ms": int(row["start_ms"]),
382
+ "duration_ms": int(row["duration_ms"]),
383
+ "intent": row["intent"],
384
+ "dialog_acts": eval(row.get("dialog_acts", "[]")),
385
+ }
386
+ elif self.config.name == "sqa5":
387
+ question_audio_file = os.path.join(
388
+ data_dir, row["split"], "question", row["question_id"] + ".wav"
389
+ )
390
+ document_audio_file = os.path.join(
391
+ data_dir, row["split"], "document", row["document_id"] + ".wav"
392
+ )
393
+ word2time_file = os.path.join(
394
+ data_dir, row["split"], "word2time", row["document_id"] + ".txt"
395
+ )
396
+ example = {
397
+ "question_id": row["question_id"],
398
+ "question_audio": question_audio_file,
399
+ "question_speaker_id": row["question_speaker_id"],
400
+ "raw_question_text": row["question_text"],
401
+ "normalized_question_text": row["normalized_question_text"],
402
+ "document_id": row["document_id"],
403
+ "document_audio": document_audio_file,
404
+ "document_speaker_id": row["document_speaker_id"],
405
+ "raw_document_text": row["document_text"],
406
+ "normalized_document_text": row["normalized_document_text"],
407
+ "word2time": load_word2time(word2time_file),
408
+ "answer_spans": parse_qa_answer_spans(row.get("answer_spans", "[]")),
409
+ }
410
+ elif self.config.name == "vp_nel":
411
+ split = "test" if "test" in filepath else "dev"
412
+ utt_id = row["id"]
413
+ word_alignments_fn = os.path.join(
414
+ data_dir, "word_timestamps", split, f"{utt_id}.json"
415
+ )
416
+ audio_file = os.path.join(
417
+ data_dir,
418
+ 'audio',
419
+ split,
420
+ f"{utt_id}.ogg",
421
+ )
422
+ example = {
423
+ "id": utt_id,
424
+ "audio": audio_file,
425
+ "speaker_id": row["speaker_id"],
426
+ "text": row["normalized_text"],
427
+ "ne_timestamps": parse_nel_time_spans(
428
+ row.get("normalized_nel", "[]")
429
+ ),
430
+ "word_timestamps": read_word_timestamps(word_alignments_fn),
431
+ }
432
+ if self.config.name == "ted":
433
+ split = "test" if "test" in filepath else "dev" if "dev" in filepath else "fine-tune"
434
+ audio_file = os.path.join(
435
+ data_dir, split,
436
+ row["id"] + ".flac"
437
+ )
438
+ if "title" not in row:
439
+ title_str=[]
440
+ else:
441
+ title_str=row["title"]
442
+ if "abstract" not in row:
443
+ abstract_str=[]
444
+ else:
445
+ abstract_str=row["abstract"]
446
+ example = {
447
+ "id": row["id"],
448
+ "audio": audio_file,
449
+ "speaker": row["speaker"],
450
+ "transcript": row["transcript"],
451
+ "title": title_str,
452
+ "abstract": abstract_str,
453
+ }
454
+ yield idx, example
sqa5/test-00000-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ec4f373261e64953c0f940ed6813140dbf0ef1f6578f5ffdffb4bc14521281f8
3
- size 391219890
 
 
 
 
sqa5/test-00001-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:68f71f5a04096d5224828695c960c7fb28dcd76b0adf1c7872c2c1c234ef5e1c
3
- size 398320406
 
 
 
 
sqa5/test-00002-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a7f96a54cddf35d2ae9c63cbfc6b33077efc146b9be8c729bb15df7c74296730
3
- size 390508385
 
 
 
 
sqa5/test-00003-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1ccecfd3824459ad94da937c9755541ebbb0cc3499c4c649bd2cafc99d740817
3
- size 394971700
 
 
 
 
sqa5/test-00004-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e4a875996daf1ed65af8e30f08feb43a5084d5dde1489c780ce66c6f9aed7bbb
3
- size 392510637
 
 
 
 
sqa5/test-00005-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e183f6c5efbdc91453a22cd256c3228175efbad4b5f4841dbda261ad9622f917
3
- size 407208647
 
 
 
 
sqa5/test-00006-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:14c4d6d9c4bcbce57b6ade98cc71e9d5fdd7a8c903e93f7df1272dc4be57a214
3
- size 420114650
 
 
 
 
sqa5/test-00007-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:33a0fcbb89ec2bd80aa4ef72a3a587dda3f1d03462d004e71174241bf99c1efa
3
- size 424014751
 
 
 
 
sqa5/test-00008-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:607871477dee74c9109a06e0725c4177267a99adc1e36059b82a6a1972ed20ee
3
- size 412558437
 
 
 
 
sqa5/test-00009-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c5776b36450d271f5a73fa8563d18ba30d057e2f32c330d1f9bf7cbc0a42c277
3
- size 429346377
 
 
 
 
sqa5/test-00010-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5cde7adda636c4211604efc1e9a981359ae43cf071a6c51afd266c7d691ef950
3
- size 432447189
 
 
 
 
sqa5/test-00011-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:dedb2cec6125f937720406fff50372b0d7a7862f7abcbaf53fa93908f9419e5e
3
- size 401746587
 
 
 
 
sqa5/test-00012-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b045cdca4522fc4dd4d7b8870c464eaac6b2285f201b7cdf9f3a5f0920613392
3
- size 399328287
 
 
 
 
sqa5/test-00013-of-00014.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c2850587aa192964b87e6bbafa44756bc193cebf814c996e0b8de9a8ca7ca607
3
- size 383522170
 
 
 
 
sqa5/train-00000-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c8c494e55c63b8298da1f01f06f56c950eb0c607320e96128425d14868862eb3
3
- size 374888133
 
 
 
 
sqa5/train-00001-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5d44b153bdddeadfc15f476361b77d3b7e9fd3e8dd1f09be8f6baccc3a422288
3
- size 350252588
 
 
 
 
sqa5/train-00002-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:de2b989e3de8b2529851b9b4790256ddb83fead522197a2eec61221e0aeb0212
3
- size 375857780
 
 
 
 
sqa5/train-00003-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b8bd6dd00eab2fefb39b75e8ac3999acaeed3550b0d61279b01ede94cadcc01f
3
- size 366340875
 
 
 
 
sqa5/train-00004-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:40778dd8506c24f8fcd720e2bd2e091e2c8888c3c6081fcc645151164c37f579
3
- size 322329434
 
 
 
 
sqa5/train-00005-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9af66699361889a55e75aebb1b049cec69922d4e242f16adff69fbfc0ae72dd9
3
- size 343519138
 
 
 
 
sqa5/train-00006-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:28597400c00531e58610f8309efdd0ae4d0b816a0bc66f85a993eeee8e2146a1
3
- size 399471716
 
 
 
 
sqa5/train-00007-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3738d105c273f16b89e3ad3d0cc3ba64d924e738c5bca7fbd446412b958fdac4
3
- size 350704425
 
 
 
 
sqa5/train-00008-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a675e196d8ac056a82b7b37703da16c9b1dc58454abba7d0fa70863b33175c87
3
- size 391258144
 
 
 
 
sqa5/train-00009-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:db76ec3875883dd37a38ed0ff39f1f5f54b5e7660aef1c8904e3e7b6b86e8d07
3
- size 367305523
 
 
 
 
sqa5/train-00010-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:880c5f2066adef13486814eb9cb81010ae1c6bc7426812ef434f9414d16a58a9
3
- size 376228623
 
 
 
 
sqa5/train-00011-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:536741ecf929ad2f8217643e82e178421928374c3159f890b3374aa91f357ea9
3
- size 349105466
 
 
 
 
sqa5/train-00012-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4276c836c3f13b9999829a85a794dc3160e760b7dc93f97f22aec74285884b96
3
- size 340655212
 
 
 
 
sqa5/train-00013-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4eecec1e9cd27c4d1db549eb7a46565bf94a995b71ec83c768e51c6f30f88827
3
- size 282705467
 
 
 
 
sqa5/train-00014-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:391f00c46ed9db8be1ca73c80f77a56f6d577f6d7cce3f4341a5e22340a99e4e
3
- size 381716536
 
 
 
 
sqa5/train-00015-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:00e9ddebe4e4036c482bd4bd58ce7d713875b4210dadb989cfda2df545ac4030
3
- size 363875559
 
 
 
 
sqa5/train-00016-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:57f51a457d92ac7f410e4a082e30c88d9973f5da9cb4a972226d1a2f8d16fb89
3
- size 337070275
 
 
 
 
sqa5/train-00017-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:47d111df90b763610fa6049d4a6550e0430790b1dfdab88ce447387cbe54a86e
3
- size 368054919
 
 
 
 
sqa5/train-00018-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0141a44cb7403571c6e130314417c2eefbe442078ab28ec4e9f22eb67bf9a1be
3
- size 362571623
 
 
 
 
sqa5/train-00019-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:661e0750d4790a14fd97559bad0eeec82b8df54f0f3ca5c61d043451eac058d4
3
- size 374936570
 
 
 
 
sqa5/train-00020-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:032cbb49378ca703c1be197c00a08e9ec98ad865d2f9532b6622bf0191c6e489
3
- size 350893953
 
 
 
 
sqa5/train-00021-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:022eebe02355e39f71e02d0b2eb3930814f0b1532e652d1556b11ea5201e0545
3
- size 378750592
 
 
 
 
sqa5/train-00022-of-00270.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a200c9aaa5096423b8be51f29fdc170eabb9a2a9f360e5c77659014a38c41614
3
- size 343773924