add
Browse files- Multidialog.py +5 -5
Multidialog.py
CHANGED
@@ -32,9 +32,9 @@ _LICENSE = "Apache License 2.0"
|
|
32 |
|
33 |
_BASE_DATA_URL = "https://huggingface.co/datasets/IVLLab/MultiDialog/resolve/main/"
|
34 |
|
35 |
-
_AUDIO_ARCHIVE_URL = _BASE_DATA_URL + "{subset}/{subset}_chunks_{archive_id:04}.tar.gz"
|
36 |
|
37 |
-
_META_URL = _BASE_DATA_URL + "metadata/{subset}_metadata_{archive_id:04}.jsonl"
|
38 |
|
39 |
|
40 |
logger = datasets.utils.logging.get_logger(__name__)
|
@@ -207,7 +207,8 @@ class Multidialog(datasets.GeneratorBasedBuilder):
|
|
207 |
meta_dict = dict()
|
208 |
with open(meta_path) as jsonl_file:
|
209 |
for line in jsonl_file:
|
210 |
-
|
|
|
211 |
# data = json.loads(line.strip())
|
212 |
# meta_csv = csv.DictReader(csvfile)
|
213 |
# for line in meta_csv:
|
@@ -217,14 +218,13 @@ class Multidialog(datasets.GeneratorBasedBuilder):
|
|
217 |
# `audio_path_in_archive` is like "dev_chunks_0000/YOU1000000029_S0000095.wav"
|
218 |
audio_filename = os.path.split(audio_path_in_archive)[1]
|
219 |
audio_id = audio_filename.split(".wav")[0]
|
220 |
-
audio_meta = meta_dict[
|
221 |
audio_meta["conv_id"] = audio_meta.pop("conv_id")
|
222 |
audio_meta["utterance_id"] = audio_meta.pop("utterance_id")
|
223 |
audio_meta["from"] = audio_meta.pop("from")
|
224 |
audio_meta["value"] = audio_meta.pop("value")
|
225 |
audio_meta["emotion"] = audio_meta.pop("emotion")
|
226 |
audio_meta["original_full_path"] = audio_meta.pop("audpath")
|
227 |
-
audio_meta["audio_id"] = audio_id
|
228 |
|
229 |
path = os.path.join(local_audio_archives_paths[i], audio_path_in_archive) if local_audio_archives_paths \
|
230 |
else audio_path_in_archive
|
|
|
32 |
|
33 |
_BASE_DATA_URL = "https://huggingface.co/datasets/IVLLab/MultiDialog/resolve/main/"
|
34 |
|
35 |
+
_AUDIO_ARCHIVE_URL = _BASE_DATA_URL + "data/{subset}/{subset}_chunks_{archive_id:04}.tar.gz"
|
36 |
|
37 |
+
_META_URL = _BASE_DATA_URL + "metadata/{subset}/{subset}_metadata_{archive_id:04}.jsonl"
|
38 |
|
39 |
|
40 |
logger = datasets.utils.logging.get_logger(__name__)
|
|
|
207 |
meta_dict = dict()
|
208 |
with open(meta_path) as jsonl_file:
|
209 |
for line in jsonl_file:
|
210 |
+
data = json.loads(line.strip())
|
211 |
+
meta_dict[data["file_name"]] = data
|
212 |
# data = json.loads(line.strip())
|
213 |
# meta_csv = csv.DictReader(csvfile)
|
214 |
# for line in meta_csv:
|
|
|
218 |
# `audio_path_in_archive` is like "dev_chunks_0000/YOU1000000029_S0000095.wav"
|
219 |
audio_filename = os.path.split(audio_path_in_archive)[1]
|
220 |
audio_id = audio_filename.split(".wav")[0]
|
221 |
+
audio_meta = meta_dict[audio_path_in_archive]
|
222 |
audio_meta["conv_id"] = audio_meta.pop("conv_id")
|
223 |
audio_meta["utterance_id"] = audio_meta.pop("utterance_id")
|
224 |
audio_meta["from"] = audio_meta.pop("from")
|
225 |
audio_meta["value"] = audio_meta.pop("value")
|
226 |
audio_meta["emotion"] = audio_meta.pop("emotion")
|
227 |
audio_meta["original_full_path"] = audio_meta.pop("audpath")
|
|
|
228 |
|
229 |
path = os.path.join(local_audio_archives_paths[i], audio_path_in_archive) if local_audio_archives_paths \
|
230 |
else audio_path_in_archive
|