Datasets:
ArXiv:
License:
supporting audio zip files
Browse files- snow-mountain.py +12 -11
snow-mountain.py
CHANGED
@@ -135,19 +135,20 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
135 |
key = 0
|
136 |
with open(filepath) as f:
|
137 |
data_df = pd.read_csv(f,sep=',')
|
138 |
-
|
139 |
for index,row in data_df.iterrows():
|
140 |
audio = row['path'].split('/')[-1]
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
151 |
yield key, {
|
152 |
"sentence": row["sentence"],
|
153 |
"path": row["path"],
|
|
|
135 |
key = 0
|
136 |
with open(filepath) as f:
|
137 |
data_df = pd.read_csv(f,sep=',')
|
138 |
+
audio_data = {}
|
139 |
for index,row in data_df.iterrows():
|
140 |
audio = row['path'].split('/')[-1]
|
141 |
+
if audio in audio_data:
|
142 |
+
content = audio_data[audio]
|
143 |
+
else:
|
144 |
+
zip_url = '/'.join(row["path"].split('/')[:-1])+'.zip'
|
145 |
+
archive_path = dl_manager.download(zip_url)
|
146 |
+
for path, file in dl_manager.iter_archive(archive_path):
|
147 |
+
content = path.read()
|
148 |
+
# audio_data[audio] = content
|
149 |
+
|
150 |
+
# # if file in str(row["path"]):
|
151 |
+
# # content = file.read()
|
152 |
yield key, {
|
153 |
"sentence": row["sentence"],
|
154 |
"path": row["path"],
|