Datasets:
License:
Upload mumospee_small.py with huggingface_hub
Browse files- mumospee_small.py +18 -19
mumospee_small.py
CHANGED
@@ -129,15 +129,13 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
129 |
]
|
130 |
|
131 |
|
132 |
-
|
133 |
def _generate_examples(self, filepath):
|
134 |
|
135 |
data = pd.read_csv(filepath)
|
136 |
-
split=self.config.split
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
tag=self.config.tag
|
141 |
|
142 |
print(f'Return {split} dataset in langauge of {language}, originally from {tag}.')
|
143 |
|
@@ -157,20 +155,21 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
157 |
print(f"No data found for split='{split}', language='{language}', tag='{tag}'. Returning None.")
|
158 |
return # This exits the generator without yielding any examples
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
174 |
|
175 |
|
176 |
|
|
|
129 |
]
|
130 |
|
131 |
|
|
|
132 |
def _generate_examples(self, filepath):
|
133 |
|
134 |
data = pd.read_csv(filepath)
|
135 |
+
split = self.config.split
|
136 |
|
137 |
+
language = self.config.language
|
138 |
+
tag = self.config.tag
|
|
|
139 |
|
140 |
print(f'Return {split} dataset in langauge of {language}, originally from {tag}.')
|
141 |
|
|
|
155 |
print(f"No data found for split='{split}', language='{language}', tag='{tag}'. Returning None.")
|
156 |
return # This exits the generator without yielding any examples
|
157 |
|
158 |
+
else:
|
159 |
+
|
160 |
+
for i, row in data_split.iterrows():
|
161 |
+
yield i, {
|
162 |
+
"path": row["path"],
|
163 |
+
#"local_path": row["local_path"],
|
164 |
+
"url": row["url"],
|
165 |
+
"type": row["type"],
|
166 |
+
"duration": float(row["duration"]),
|
167 |
+
"language": row["language"],
|
168 |
+
"transcript": row["transcript"],
|
169 |
+
"tag": row["tag"],
|
170 |
+
"split": row["split"],
|
171 |
+
"license": row["license"]
|
172 |
+
}
|
173 |
|
174 |
|
175 |
|