Update builder.py
Browse files- builder.py +4 -9
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 + "metadata1.
|
| 72 |
}
|
| 73 |
|
| 74 |
|
|
@@ -99,11 +99,6 @@ class NepaliAsr(datasets.GeneratorBasedBuilder):
|
|
| 99 |
license=_LICENSE,
|
| 100 |
# Citation for the dataset
|
| 101 |
citation=_CITATION,
|
| 102 |
-
task_templates=[
|
| 103 |
-
datasets.tasks.AutomaticSpeechRecognition(
|
| 104 |
-
audio_column="utterance", transcription_column="transcription"
|
| 105 |
-
)
|
| 106 |
-
],
|
| 107 |
)
|
| 108 |
|
| 109 |
def _split_generators(self, dl_manager):
|
|
@@ -127,11 +122,11 @@ class NepaliAsr(datasets.GeneratorBasedBuilder):
|
|
| 127 |
|
| 128 |
def _generate_examples(self, index_file, audio_paths):
|
| 129 |
with open(index_file, encoding="utf-8") as f:
|
| 130 |
-
reader = csv.DictReader(f
|
| 131 |
for key, row in enumerate(reader):
|
| 132 |
-
path = os.path.join(audio_paths, "CLEAN_DATA",
|
| 133 |
yield key, {
|
| 134 |
-
"utterance_id": row["utterance_id"],
|
| 135 |
"utterance": path,
|
| 136 |
"transcription": row["transcription"],
|
| 137 |
}
|
|
|
|
| 68 |
_URL = "https://huggingface.co/datasets/SumitMdhr/ASR/resolve/main/"
|
| 69 |
_URLS = {
|
| 70 |
"zipfile": _URL + "CLEAN_DATA.zip",
|
| 71 |
+
"index_file": _URL + "metadata1.csv",
|
| 72 |
}
|
| 73 |
|
| 74 |
|
|
|
|
| 99 |
license=_LICENSE,
|
| 100 |
# Citation for the dataset
|
| 101 |
citation=_CITATION,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
)
|
| 103 |
|
| 104 |
def _split_generators(self, dl_manager):
|
|
|
|
| 122 |
|
| 123 |
def _generate_examples(self, index_file, audio_paths):
|
| 124 |
with open(index_file, encoding="utf-8") as f:
|
| 125 |
+
reader = csv.DictReader(f)
|
| 126 |
for key, row in enumerate(reader):
|
| 127 |
+
path = os.path.join(audio_paths, "CLEAN_DATA", row['utterance_id'])
|
| 128 |
yield key, {
|
| 129 |
+
"utterance_id": row["utterance_id"].replace(".flac",""),
|
| 130 |
"utterance": path,
|
| 131 |
"transcription": row["transcription"],
|
| 132 |
}
|