Update birdsdataset.py
Browse files- birdsdataset.py +3 -3
birdsdataset.py
CHANGED
|
@@ -348,7 +348,7 @@ class AudioDataset(datasets.GeneratorBasedBuilder):
|
|
| 348 |
]
|
| 349 |
|
| 350 |
def _generate_examples(self, audio_path, text_paths):
|
| 351 |
-
|
| 352 |
|
| 353 |
with open(text_paths, encoding="utf-8") as csv_file:
|
| 354 |
csv_reader = csv.reader(csv_file, delimiter=",", skipinitialspace=True)
|
|
@@ -358,9 +358,9 @@ class AudioDataset(datasets.GeneratorBasedBuilder):
|
|
| 358 |
#file_path, transcription, english_transcription, intent_class = row
|
| 359 |
|
| 360 |
file_path = os.path.join(audio_path, *file_path.split("/"))
|
| 361 |
-
yield {
|
| 362 |
#"path": file_path,
|
| 363 |
"audio": file_path,
|
| 364 |
"label": label,
|
| 365 |
}
|
| 366 |
-
|
|
|
|
| 348 |
]
|
| 349 |
|
| 350 |
def _generate_examples(self, audio_path, text_paths):
|
| 351 |
+
key = 0
|
| 352 |
|
| 353 |
with open(text_paths, encoding="utf-8") as csv_file:
|
| 354 |
csv_reader = csv.reader(csv_file, delimiter=",", skipinitialspace=True)
|
|
|
|
| 358 |
#file_path, transcription, english_transcription, intent_class = row
|
| 359 |
|
| 360 |
file_path = os.path.join(audio_path, *file_path.split("/"))
|
| 361 |
+
yield key, {
|
| 362 |
#"path": file_path,
|
| 363 |
"audio": file_path,
|
| 364 |
"label": label,
|
| 365 |
}
|
| 366 |
+
key += 1
|