bjelkenhed
commited on
Commit
·
5f51769
1
Parent(s):
e3daa1d
metadata_se_csv.zip
Browse files- archive/nst/metadata_se_csv.zip +3 -0
- babelbox_voice.py +17 -4
archive/nst/metadata_se_csv.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:94993f25e3cc9415a465dbdb1529a300aca3dc24e0a29cdfb112d153be06f1bc
|
3 |
+
size 19735371
|
babelbox_voice.py
CHANGED
@@ -29,7 +29,7 @@ _DL_URLS = [
|
|
29 |
"https://huggingface.co/datasets/babelbox/babelbox_voice/resolve/main/archive/nst/nst-data-002.tar.gz"
|
30 |
]
|
31 |
|
32 |
-
_METADATA_URL = "https://huggingface.co/datasets/babelbox/babelbox_voice/resolve/main/archive/nst/
|
33 |
|
34 |
class BabelboxVoiceConfig(datasets.BuilderConfig):
|
35 |
"""BuilderConfig for BabelboxVoice."""
|
@@ -95,12 +95,24 @@ class BabelboxVoice(datasets.GeneratorBasedBuilder):
|
|
95 |
|
96 |
local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
|
97 |
|
98 |
-
meta_url = self.config.meta_url
|
99 |
|
100 |
-
meta_path = dl_manager.download_and_extract(_METADATA_URL)
|
101 |
|
102 |
-
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
metadata = {}
|
105 |
with open(meta_path, encoding="utf-8") as f:
|
106 |
reader = csv.DictReader(f)
|
@@ -108,6 +120,7 @@ class BabelboxVoice(datasets.GeneratorBasedBuilder):
|
|
108 |
filename = row['filename_channel_1']
|
109 |
sentence = row['text']
|
110 |
metadata[filename] = sentence
|
|
|
111 |
|
112 |
return [
|
113 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
|
|
29 |
"https://huggingface.co/datasets/babelbox/babelbox_voice/resolve/main/archive/nst/nst-data-002.tar.gz"
|
30 |
]
|
31 |
|
32 |
+
_METADATA_URL = "https://huggingface.co/datasets/babelbox/babelbox_voice/resolve/main/archive/nst/metadata.tar.gz"
|
33 |
|
34 |
class BabelboxVoiceConfig(datasets.BuilderConfig):
|
35 |
"""BuilderConfig for BabelboxVoice."""
|
|
|
95 |
|
96 |
local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
|
97 |
|
98 |
+
#meta_url = self.config.meta_url
|
99 |
|
100 |
+
#meta_path = dl_manager.download_and_extract(_METADATA_URL)
|
101 |
|
102 |
+
meta_archive = dl_manager.iter_archive(_METADATA_URL)
|
103 |
|
104 |
+
print(meta_archive)
|
105 |
+
|
106 |
+
metadata = {}
|
107 |
+
for path, file in meta_archive:
|
108 |
+
print(type(file))
|
109 |
+
reader = csv.DictReader(file)
|
110 |
+
for row in tqdm(reader, desc="Reading metadata..."):
|
111 |
+
filename = row['filename_channel_1']
|
112 |
+
sentence = row['text']
|
113 |
+
metadata[filename] = sentence
|
114 |
+
|
115 |
+
"""
|
116 |
metadata = {}
|
117 |
with open(meta_path, encoding="utf-8") as f:
|
118 |
reader = csv.DictReader(f)
|
|
|
120 |
filename = row['filename_channel_1']
|
121 |
sentence = row['text']
|
122 |
metadata[filename] = sentence
|
123 |
+
"""
|
124 |
|
125 |
return [
|
126 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|