Update builder.py
Browse files- builder.py +5 -5
builder.py
CHANGED
|
@@ -68,7 +68,7 @@ _LICENSE = "license:cc-by-sa-4.0"
|
|
| 68 |
_URL = "https://huggingface.co/datasets/SumitMdhr/ASR/resolve/main/"
|
| 69 |
_URLS = {
|
| 70 |
"zipfile": _URL + "CLEAN_DATA.zip",
|
| 71 |
-
"index_file": _URL + "
|
| 72 |
}
|
| 73 |
|
| 74 |
|
|
@@ -108,7 +108,7 @@ class NepaliAsr(datasets.GeneratorBasedBuilder):
|
|
| 108 |
|
| 109 |
def _split_generators(self, dl_manager):
|
| 110 |
index_file = dl_manager.download(_URLS["index_file"])
|
| 111 |
-
zip_paths = dl_manager.download(_URLS[
|
| 112 |
audio_paths = dl_manager.extract(zip_paths)
|
| 113 |
for path in zip_paths:
|
| 114 |
if os.path.exists(path):
|
|
@@ -127,9 +127,9 @@ class NepaliAsr(datasets.GeneratorBasedBuilder):
|
|
| 127 |
with open(index_file, encoding="utf-8") as f:
|
| 128 |
reader = csv.DictReader(f , delimiter="\t")
|
| 129 |
for key, row in enumerate(reader):
|
| 130 |
-
path = os.path.join(
|
| 131 |
yield key, {
|
| 132 |
-
"utterance_id": row["utterance_id"]
|
| 133 |
"utterance": path,
|
| 134 |
"transcription": row["transcription"],
|
| 135 |
-
}
|
|
|
|
| 68 |
_URL = "https://huggingface.co/datasets/SumitMdhr/ASR/resolve/main/"
|
| 69 |
_URLS = {
|
| 70 |
"zipfile": _URL + "CLEAN_DATA.zip",
|
| 71 |
+
"index_file": _URL + "metedata1.tsv",
|
| 72 |
}
|
| 73 |
|
| 74 |
|
|
|
|
| 108 |
|
| 109 |
def _split_generators(self, dl_manager):
|
| 110 |
index_file = dl_manager.download(_URLS["index_file"])
|
| 111 |
+
zip_paths = dl_manager.download(_URLS["zipfile"])
|
| 112 |
audio_paths = dl_manager.extract(zip_paths)
|
| 113 |
for path in zip_paths:
|
| 114 |
if os.path.exists(path):
|
|
|
|
| 127 |
with open(index_file, encoding="utf-8") as f:
|
| 128 |
reader = csv.DictReader(f , delimiter="\t")
|
| 129 |
for key, row in enumerate(reader):
|
| 130 |
+
path = os.path.join(audio_paths, "CLEAN_DATA", row['utterance_id'])
|
| 131 |
yield key, {
|
| 132 |
+
"utterance_id": row["utterance_id"],
|
| 133 |
"utterance": path,
|
| 134 |
"transcription": row["transcription"],
|
| 135 |
+
}
|