Zeb
commited on
Commit
•
9f96187
1
Parent(s):
959a621
Fix loading strict dataset
Browse files
BabyLM.py
CHANGED
@@ -234,39 +234,9 @@ class BabyLM(datasets.GeneratorBasedBuilder):
|
|
234 |
Returns data for different splits
|
235 |
"""
|
236 |
|
237 |
-
|
238 |
-
if "fr_lang_small" in self.config.name:
|
239 |
-
train_data_dir = "FR"
|
240 |
-
elif "de_lang_small" in self.config.name:
|
241 |
-
train_data_dir = "DE"
|
242 |
-
elif "zh_lang_small" in self.config.name:
|
243 |
-
train_data_dir = "ZH"
|
244 |
-
elif "ja_lang_small" in self.config.name:
|
245 |
-
train_data_dir = "JA"
|
246 |
-
elif "es_lang_small" in self.config.name:
|
247 |
-
train_data_dir = "SP"
|
248 |
-
elif "nld_lang_small" in self.config.name:
|
249 |
-
train_data_dir = "DUT"
|
250 |
-
elif "po_lang_small" in self.config.name:
|
251 |
-
train_data_dir = "PORT"
|
252 |
-
elif "ron_lang_small" in self.config.name:
|
253 |
-
train_data_dir = "ROM"
|
254 |
-
elif "cat_lang_small" in self.config.name:
|
255 |
-
train_data_dir = "CAT"
|
256 |
-
elif "sem_strict_small" in self.config.name:
|
257 |
-
train_data_dir = "SEM"
|
258 |
-
elif "sem_zh_small" in self.config.name:
|
259 |
-
train_data_dir = "SEM-ZH"
|
260 |
-
elif "strict_small" in self.config.name: #default settings – English
|
261 |
-
train_data_dir = "10M"
|
262 |
-
else:
|
263 |
-
train_data_dir = "100M"
|
264 |
-
|
265 |
-
|
266 |
folder = 'original_tagged' if 'original' in self.config.name else 'clean_tagged' #
|
267 |
folder = folder + '_gold' if 'gold' in self.config.name else folder #gold tags for french, german, japanese and english
|
268 |
|
269 |
-
|
270 |
#modified urls to download
|
271 |
|
272 |
urls_to_download = {
|
@@ -319,10 +289,14 @@ class BabyLM(datasets.GeneratorBasedBuilder):
|
|
319 |
urls_to_download["train"] = [f"{folder}/SEM/{fn}" for fn in sem_en_filenames]
|
320 |
urls_to_download["dev"] = [f"{folder}/dev/{fn}" for fn in en_filenames]
|
321 |
urls_to_download["test"] = [f"{folder}/test/{fn}" for fn in en_filenames]
|
322 |
-
|
323 |
urls_to_download["train"] = [f"{folder}/10M/{fn}" for fn in en_filenames]
|
324 |
urls_to_download["dev"] = [f"{folder}/dev/{fn}" for fn in en_filenames]
|
325 |
urls_to_download["test"] = [f"{folder}/test/{fn}" for fn in en_filenames]
|
|
|
|
|
|
|
|
|
326 |
|
327 |
|
328 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
|
|
234 |
Returns data for different splits
|
235 |
"""
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
folder = 'original_tagged' if 'original' in self.config.name else 'clean_tagged' #
|
238 |
folder = folder + '_gold' if 'gold' in self.config.name else folder #gold tags for french, german, japanese and english
|
239 |
|
|
|
240 |
#modified urls to download
|
241 |
|
242 |
urls_to_download = {
|
|
|
289 |
urls_to_download["train"] = [f"{folder}/SEM/{fn}" for fn in sem_en_filenames]
|
290 |
urls_to_download["dev"] = [f"{folder}/dev/{fn}" for fn in en_filenames]
|
291 |
urls_to_download["test"] = [f"{folder}/test/{fn}" for fn in en_filenames]
|
292 |
+
elif 'strict_small' in self.config.name:
|
293 |
urls_to_download["train"] = [f"{folder}/10M/{fn}" for fn in en_filenames]
|
294 |
urls_to_download["dev"] = [f"{folder}/dev/{fn}" for fn in en_filenames]
|
295 |
urls_to_download["test"] = [f"{folder}/test/{fn}" for fn in en_filenames]
|
296 |
+
else:
|
297 |
+
urls_to_download["train"] = [f"{folder}/100M/{fn}" for fn in en_filenames]
|
298 |
+
urls_to_download["dev"] = [f"{folder}/dev/{fn}" for fn in en_filenames]
|
299 |
+
urls_to_download["test"] = [f"{folder}/test/{fn}" for fn in en_filenames]
|
300 |
|
301 |
|
302 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|