fix audio path?
Browse files
temp_africaNLP_keyword_spotting_for_african_languages.py
CHANGED
@@ -137,6 +137,7 @@ class TempAfricaNLPKeywordSpottingForAfricanLanguages(datasets.GeneratorBasedBui
|
|
137 |
gen_kwargs={
|
138 |
"filepath": os.path.join(data_dir, "clips.xlsx"),
|
139 |
"split": "train",
|
|
|
140 |
},
|
141 |
),
|
142 |
#
|
@@ -160,7 +161,7 @@ class TempAfricaNLPKeywordSpottingForAfricanLanguages(datasets.GeneratorBasedBui
|
|
160 |
]
|
161 |
|
162 |
def _generate_examples(
|
163 |
-
self, filepath, split
|
164 |
):
|
165 |
""" Yields examples as (key, example) tuples. """
|
166 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
@@ -174,5 +175,5 @@ class TempAfricaNLPKeywordSpottingForAfricanLanguages(datasets.GeneratorBasedBui
|
|
174 |
yield id_, {
|
175 |
"sentence": data["sentence"],
|
176 |
"path": data["path"],
|
177 |
-
"audio": data["path"], # set the audio feature, should be able to handle things automatically?
|
178 |
}
|
|
|
137 |
gen_kwargs={
|
138 |
"filepath": os.path.join(data_dir, "clips.xlsx"),
|
139 |
"split": "train",
|
140 |
+
"data_dir":data_dir,
|
141 |
},
|
142 |
),
|
143 |
#
|
|
|
161 |
]
|
162 |
|
163 |
def _generate_examples(
|
164 |
+
self, filepath, split, data_dir # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
165 |
):
|
166 |
""" Yields examples as (key, example) tuples. """
|
167 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
|
|
175 |
yield id_, {
|
176 |
"sentence": data["sentence"],
|
177 |
"path": data["path"],
|
178 |
+
"audio": os.path.join(data_dir, data["path"]), # set the audio feature, should be able to handle things automatically?
|
179 |
}
|