Datasets:
Languages:
Sundanese
Tags:
speech-recognition
Update su_id_asr_split.py
Browse files- su_id_asr_split.py +11 -19
su_id_asr_split.py
CHANGED
@@ -93,30 +93,22 @@ class SuIdASR(datasets.GeneratorBasedBuilder):
|
|
93 |
)
|
94 |
|
95 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
96 |
-
|
97 |
-
|
98 |
for id in range(10):
|
99 |
-
|
100 |
-
datasets.SplitGenerator(
|
101 |
-
name=datasets.Split(str(id)),
|
102 |
-
gen_kwargs={"split_key": str(id), "dl_manager": dl_manager},
|
103 |
-
)
|
104 |
-
)
|
105 |
for id in ["a", "b", "c", "d", "e", "f"]:
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
)
|
112 |
-
|
113 |
-
return dsets
|
114 |
|
115 |
-
def _generate_examples(self,
|
116 |
|
117 |
if self.config.schema == "source" or self.config.schema == "seacrowd_sptext":
|
118 |
-
|
119 |
-
|
120 |
for key, each_filepath in filepath.items():
|
121 |
|
122 |
tsv_file = os.path.join(each_filepath, "asr_sundanese", "utt_spk_text.tsv")
|
|
|
93 |
)
|
94 |
|
95 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
96 |
+
base_path = {}
|
|
|
97 |
for id in range(10):
|
98 |
+
base_path[id] = dl_manager.download_and_extract(_URLs["su_id_asr"].format(str(id)))
|
|
|
|
|
|
|
|
|
|
|
99 |
for id in ["a", "b", "c", "d", "e", "f"]:
|
100 |
+
base_path[id] = dl_manager.download_and_extract(_URLs["su_id_asr"].format(str(id)))
|
101 |
+
return [
|
102 |
+
datasets.SplitGenerator(
|
103 |
+
name=datasets.Split.TRAIN,
|
104 |
+
gen_kwargs={"filepath": base_path},
|
105 |
+
),
|
106 |
+
]
|
|
|
107 |
|
108 |
+
def _generate_examples(self, filepath: Dict):
|
109 |
|
110 |
if self.config.schema == "source" or self.config.schema == "seacrowd_sptext":
|
111 |
+
|
|
|
112 |
for key, each_filepath in filepath.items():
|
113 |
|
114 |
tsv_file = os.path.join(each_filepath, "asr_sundanese", "utt_spk_text.tsv")
|