Update self_dataset.py
Browse files- self_dataset.py +9 -5
self_dataset.py
CHANGED
|
@@ -87,15 +87,17 @@ class ATC(datasets.GeneratorBasedBuilder):
|
|
| 87 |
langs = _ALL_CONFIGS
|
| 88 |
features = datasets.Features(
|
| 89 |
{
|
| 90 |
-
"
|
| 91 |
-
"
|
|
|
|
|
|
|
| 92 |
}
|
| 93 |
)
|
| 94 |
|
| 95 |
return datasets.DatasetInfo(
|
| 96 |
description=_DESCRIPTION,
|
| 97 |
features=features,
|
| 98 |
-
supervised_keys=("
|
| 99 |
homepage=self.config.homepage,
|
| 100 |
citation=_CITATION,
|
| 101 |
task_templates=task_templates,
|
|
@@ -140,7 +142,9 @@ class ATC(datasets.GeneratorBasedBuilder):
|
|
| 140 |
file_path, reference = row
|
| 141 |
file_path = os.path.join(audio_path, *file_path.split("/"))
|
| 142 |
yield key, {
|
| 143 |
-
"
|
| 144 |
-
"
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
key += 1
|
|
|
|
| 87 |
langs = _ALL_CONFIGS
|
| 88 |
features = datasets.Features(
|
| 89 |
{
|
| 90 |
+
"path": datasets.Value("string"),
|
| 91 |
+
"audio": datasets.Audio(sampling_rate=16_000),
|
| 92 |
+
"transcription": datasets.Value("string"),
|
| 93 |
+
"lang_id": datasets.ClassLabel(names=langs),
|
| 94 |
}
|
| 95 |
)
|
| 96 |
|
| 97 |
return datasets.DatasetInfo(
|
| 98 |
description=_DESCRIPTION,
|
| 99 |
features=features,
|
| 100 |
+
supervised_keys=("audio", "transcription"),
|
| 101 |
homepage=self.config.homepage,
|
| 102 |
citation=_CITATION,
|
| 103 |
task_templates=task_templates,
|
|
|
|
| 142 |
file_path, reference = row
|
| 143 |
file_path = os.path.join(audio_path, *file_path.split("/"))
|
| 144 |
yield key, {
|
| 145 |
+
"path": file_path,
|
| 146 |
+
"audio": file_path,
|
| 147 |
+
"transcription": transcription,
|
| 148 |
+
"lang_id": _ALL_CONFIGS.index(lang),
|
| 149 |
}
|
| 150 |
key += 1
|