Progress
Browse files- nena_speech_1_0.py +60 -55
nena_speech_1_0.py
CHANGED
@@ -92,58 +92,63 @@ class NENASpeech(datasets.GeneratorBasedBuilder):
|
|
92 |
)
|
93 |
|
94 |
def _split_generators(self, dl_manager):
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
92 |
)
|
93 |
|
94 |
def _split_generators(self, dl_manager):
|
95 |
+
pass
|
96 |
+
|
97 |
+
# def _split_generators(self, dl_manager):
|
98 |
+
# dialect = self.config.name
|
99 |
+
|
100 |
+
# audio_urls = {}
|
101 |
+
# splits = ("train", "dev", "test")
|
102 |
+
# for split in splits:
|
103 |
+
# audio_urls[split] = _AUDIO_URL.format(dialect=dialect, split=split)
|
104 |
+
# archive_paths = dl_manager.download(audio_urls)
|
105 |
+
# local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
|
106 |
+
|
107 |
+
# meta_urls = {split: _TRANSCRIPT_URL.format(dialect=dialect, split=split) for split in splits}
|
108 |
+
# meta_paths = dl_manager.download_and_extract(meta_urls)
|
109 |
+
|
110 |
+
# split_generators = []
|
111 |
+
# split_names = {
|
112 |
+
# "train": datasets.Split.TRAIN,
|
113 |
+
# "dev": datasets.Split.VALIDATION,
|
114 |
+
# "test": datasets.Split.TEST,
|
115 |
+
# }
|
116 |
+
# for split in splits:
|
117 |
+
# split_generators.append(
|
118 |
+
# datasets.SplitGenerator(
|
119 |
+
# name=split_names.get(split, split),
|
120 |
+
# gen_kwargs={
|
121 |
+
# "local_extracted_archive_paths": local_extracted_archive_paths.get(split),
|
122 |
+
# "archive": dl_manager.iter_archive(archive_paths.get(split)),
|
123 |
+
# "meta_path": meta_paths[split],
|
124 |
+
# },
|
125 |
+
# ),
|
126 |
+
# )
|
127 |
+
|
128 |
+
# return split_generators
|
129 |
+
|
130 |
+
def _generate_examples(self):
|
131 |
+
pass
|
132 |
+
# def _generate_examples(self, local_extracted_archive_paths, archive, meta_path):
|
133 |
+
# data_fields = list(self._info().features.keys())
|
134 |
+
# metadata = {}
|
135 |
+
# with open(meta_path, encoding="utf-8") as f:
|
136 |
+
# reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
|
137 |
+
# for row in tqdm(reader, desc="Reading metadata..."):
|
138 |
+
# if not row["path"].endswith(".mp3"):
|
139 |
+
# row["path"] += ".mp3"
|
140 |
+
# # if data is incomplete, fill with empty values
|
141 |
+
# for field in data_fields:
|
142 |
+
# if field not in row:
|
143 |
+
# row[field] = ""
|
144 |
+
# metadata[row["path"]] = row
|
145 |
+
|
146 |
+
# for path, file in archive:
|
147 |
+
# _, filename = os.path.split(path)
|
148 |
+
# if filename in metadata:
|
149 |
+
# result = dict(metadata[filename])
|
150 |
+
# # set the audio feature and the path to the extracted file
|
151 |
+
# path = os.path.join(local_extracted_archive_paths, path) if local_extracted_archive_paths else path
|
152 |
+
# result["audio"] = {"path": path, "bytes": file.read()}
|
153 |
+
# result["path"] = path
|
154 |
+
# yield path, result
|