Datasets:
add audio id column
Browse files- darija10.py +4 -2
- metadata.csv +0 -0
darija10.py
CHANGED
@@ -20,12 +20,14 @@ for file in Path("dvoice-v1.0/transcriptions/csv").iterdir():
|
|
20 |
shutil.copy(Path("dvoice-v1.0/audios_fixed") / audio_path, split_audios_path)
|
21 |
all_rows.append(row)
|
22 |
|
23 |
-
columns = ["file_name", "sample_rate", "transcript", "duration"]
|
24 |
with (Path("darija10") / "metadata.csv").open("w", newline='', encoding="utf-8") as f:
|
25 |
writer = csv.DictWriter(f, fieldnames=columns)
|
26 |
writer.writeheader()
|
27 |
for row in all_rows:
|
28 |
row["file_name"] = row["path"]
|
|
|
29 |
del row["path"]
|
30 |
writer.writerow(row)
|
31 |
-
|
|
|
|
20 |
shutil.copy(Path("dvoice-v1.0/audios_fixed") / audio_path, split_audios_path)
|
21 |
all_rows.append(row)
|
22 |
|
23 |
+
columns = ["file_name", "sample_rate", "transcript", "duration", "audio_id"]
|
24 |
with (Path("darija10") / "metadata.csv").open("w", newline='', encoding="utf-8") as f:
|
25 |
writer = csv.DictWriter(f, fieldnames=columns)
|
26 |
writer.writeheader()
|
27 |
for row in all_rows:
|
28 |
row["file_name"] = row["path"]
|
29 |
+
row["audio_id"] = Path(row["file_name"]).stem
|
30 |
del row["path"]
|
31 |
writer.writerow(row)
|
32 |
+
|
33 |
+
|
metadata.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|