Update NST.py
Browse files
NST.py
CHANGED
|
@@ -140,7 +140,7 @@ class Nst(datasets.GeneratorBasedBuilder):
|
|
| 140 |
"microphone_position": datasets.Value("string"),
|
| 141 |
# Metadata
|
| 142 |
"pid": datasets.Value("string"), # "no14xx31-24012000-1820",
|
| 143 |
-
"age": datasets.Value("int32"), #
|
| 144 |
"region_of_birth": datasets.Value("string"), # "Voss og omland",
|
| 145 |
"region_of_youth": datasets.Value("string"), # "Voss og omland",
|
| 146 |
"remarks": datasets.Value("string"), # "Some text",
|
|
@@ -165,19 +165,19 @@ class Nst(datasets.GeneratorBasedBuilder):
|
|
| 165 |
"frequency": datasets.Value("int32"), # 16000,
|
| 166 |
"memo": datasets.Value("string"), # "",
|
| 167 |
"script": datasets.Value("string"), # "464",
|
| 168 |
-
"version": datasets.Value("string"), #
|
| 169 |
-
"dst": datasets.Value("string"), #
|
| 170 |
-
"noi": datasets.Value("string"), #
|
| 171 |
-
"qua": datasets.Value("string"), #
|
| 172 |
-
"snd": datasets.Value("string"), #
|
| 173 |
-
"spc": datasets.Value("string"), #
|
| 174 |
-
"utt": datasets.Value("string"), #
|
| 175 |
-
"file": datasets.Value("string"), #
|
| 176 |
-
"t0": datasets.Value("int32"), #
|
| 177 |
-
"t1": datasets.Value("int32"), #
|
| 178 |
-
"t2": datasets.Value("int32"), #
|
| 179 |
-
"text": datasets.Value("string"), #
|
| 180 |
-
"type": datasets.Value("string"), #
|
| 181 |
}),
|
| 182 |
supervised_keys=None,
|
| 183 |
homepage=_HOMEPAGE,
|
|
@@ -194,14 +194,14 @@ class Nst(datasets.GeneratorBasedBuilder):
|
|
| 194 |
"""Returns SplitGenerators."""
|
| 195 |
data_urls = {}
|
| 196 |
lang_code, mic = self.config.name.split("-")
|
| 197 |
-
if
|
| 198 |
-
|
| 199 |
else:
|
| 200 |
-
|
| 201 |
for split in ["train", "test"]:
|
| 202 |
data_urls[split] = []
|
| 203 |
-
for
|
| 204 |
-
shard_total = _SHARDS[
|
| 205 |
for shard_idx in range(1, shard_total + 1):
|
| 206 |
# .../data/{split}/nst_{lang_code}_{split}_{mic}-{shard_idx}-of-{shard_total}
|
| 207 |
string_formating = dict(
|
|
|
|
| 140 |
"microphone_position": datasets.Value("string"),
|
| 141 |
# Metadata
|
| 142 |
"pid": datasets.Value("string"), # "no14xx31-24012000-1820",
|
| 143 |
+
"age": datasets.Value("int32"), # 18,
|
| 144 |
"region_of_birth": datasets.Value("string"), # "Voss og omland",
|
| 145 |
"region_of_youth": datasets.Value("string"), # "Voss og omland",
|
| 146 |
"remarks": datasets.Value("string"), # "Some text",
|
|
|
|
| 165 |
"frequency": datasets.Value("int32"), # 16000,
|
| 166 |
"memo": datasets.Value("string"), # "",
|
| 167 |
"script": datasets.Value("string"), # "464",
|
| 168 |
+
"version": datasets.Value("string"), # "0001_1",
|
| 169 |
+
"dst": datasets.Value("string"), # "0",
|
| 170 |
+
"noi": datasets.Value("string"), # "0",
|
| 171 |
+
"qua": datasets.Value("string"), # "X",
|
| 172 |
+
"snd": datasets.Value("string"), # "0",
|
| 173 |
+
"spc": datasets.Value("string"), # "0",
|
| 174 |
+
"utt": datasets.Value("string"), # "0",
|
| 175 |
+
"file": datasets.Value("string"), # "u0006733.wav",
|
| 176 |
+
"t0": datasets.Value("int32"), # 417024,
|
| 177 |
+
"t1": datasets.Value("int32"), # 249777024,
|
| 178 |
+
"t2": datasets.Value("int32"), # 250193024,
|
| 179 |
+
"text": datasets.Value("string"), # "Selv rett utenfor administrasjonsbygningen er det anlagt en liten fotballbane.",
|
| 180 |
+
"type": datasets.Value("string"), # "ISp71",
|
| 181 |
}),
|
| 182 |
supervised_keys=None,
|
| 183 |
homepage=_HOMEPAGE,
|
|
|
|
| 194 |
"""Returns SplitGenerators."""
|
| 195 |
data_urls = {}
|
| 196 |
lang_code, mic = self.config.name.split("-")
|
| 197 |
+
if mic == "both":
|
| 198 |
+
mics = ["close", "distant"]
|
| 199 |
else:
|
| 200 |
+
mics = [mic]
|
| 201 |
for split in ["train", "test"]:
|
| 202 |
data_urls[split] = []
|
| 203 |
+
for mic in mics:
|
| 204 |
+
shard_total = _SHARDS[mic][split]
|
| 205 |
for shard_idx in range(1, shard_total + 1):
|
| 206 |
# .../data/{split}/nst_{lang_code}_{split}_{mic}-{shard_idx}-of-{shard_total}
|
| 207 |
string_formating = dict(
|