Commit
•
388dd21
1
Parent(s):
9b337f2
Update dataset.py
Browse files- dataset.py +3 -5
dataset.py
CHANGED
@@ -14,15 +14,14 @@ class AudioDataset(datasets.GeneratorBasedBuilder):
|
|
14 |
)
|
15 |
|
16 |
def _split_generators(self, dl_manager):
|
17 |
-
data_dir = "data" # Base directory containing both metadata and audio subdirectory
|
18 |
return [
|
19 |
datasets.SplitGenerator(
|
20 |
name=datasets.Split.TRAIN,
|
21 |
-
gen_kwargs={"filepath":
|
22 |
),
|
23 |
datasets.SplitGenerator(
|
24 |
name=datasets.Split.TEST,
|
25 |
-
gen_kwargs={"filepath":
|
26 |
),
|
27 |
]
|
28 |
|
@@ -40,5 +39,4 @@ class AudioDataset(datasets.GeneratorBasedBuilder):
|
|
40 |
"transcription": transcription,
|
41 |
"speaker_id": speaker_id,
|
42 |
"audio": f"{audio_dir}/{file_name.split('/')[-1]}", # Extract the filename from the path and prepend the audio directory
|
43 |
-
}
|
44 |
-
|
|
|
14 |
)
|
15 |
|
16 |
def _split_generators(self, dl_manager):
|
|
|
17 |
return [
|
18 |
datasets.SplitGenerator(
|
19 |
name=datasets.Split.TRAIN,
|
20 |
+
gen_kwargs={"filepath": "train_metadata.csv", "audio_dir": "audio"},
|
21 |
),
|
22 |
datasets.SplitGenerator(
|
23 |
name=datasets.Split.TEST,
|
24 |
+
gen_kwargs={"filepath": "test_metadata.csv", "audio_dir": "audio"},
|
25 |
),
|
26 |
]
|
27 |
|
|
|
39 |
"transcription": transcription,
|
40 |
"speaker_id": speaker_id,
|
41 |
"audio": f"{audio_dir}/{file_name.split('/')[-1]}", # Extract the filename from the path and prepend the audio directory
|
42 |
+
}
|
|