|
from datasets import load_dataset |
|
import shutil |
|
import os |
|
|
|
|
|
lan = "eng" |
|
download_dir = os.path.join("../env/data", lan) |
|
|
|
|
|
if os.path.exists(download_dir): |
|
shutil.rmtree(download_dir) |
|
os.makedirs(download_dir) |
|
|
|
|
|
dataset = load_dataset("SemRel/SemRel2024", lan, split=['train', 'dev', 'test']) |
|
|
|
|
|
for split_name, split_data in zip(['train', 'dev', 'test'], dataset): |
|
split_data.to_csv(f"{download_dir}/{lan}_{split_name}.csv", index=False) |
|
|
|
|
|
print(f"Dataset downloaded and saved to {download_dir}") |
|
for split_name in ['train', 'dev', 'test']: |
|
print(f"{lan}_{split_name} split saved to {download_dir}/{lan}_{split_name}.csv") |
|
|