Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:

Missing train/validation/test subdirectories

#6
by albertvillanova HF staff - opened

Reported by @singultek : https://huggingface.co/datasets/lex_glue/discussions/5#65a555573e3a00a9c15f78df

I have been facing some problems since you updated the LexGLUE dataset (PR #5). I believe you may miss train/validation/test subdirectories under all the different tasks. Of course, it could be an intentional change; however, most of the codes written for the LexGLUE dataset, even the source code on GitHub(https://github.com/coastalcph/lex-glue/blob/main/experiments/eurlex.py) (please see the copied and pasted code snippet below), use train/validation/test splits while loading the datasets. Would it be possible to return the subdirectories? If not possible, the source code could be corrected by deleting the data_dir argument on the load_dataset method.

# Downloading and loading eurlex dataset from the hub.
if training_args.do_train:
    train_dataset = load_dataset("lex_glue", name=data_args.task, split="train", data_dir='data',
                                 cache_dir=model_args.cache_dir)

if training_args.do_eval:
    eval_dataset = load_dataset("lex_glue", name=data_args.task, split="validation", data_dir='data',
                                cache_dir=model_args.cache_dir)

if training_args.do_predict:
    predict_dataset = load_dataset("lex_glue", name=data_args.task, split="test", data_dir='data',
                                   cache_dir=model_args.cache_dir)

Thanks for reporting, @singultek .

The current version of this dataset does indeed contain train/validation/test splits. See, for example the 3 files within the directory case_hold: https://huggingface.co/datasets/lex_glue/tree/main/case_hold
However, you should not pass the data_dir parameter to load_dataset.

Where did you get that code snippet? I cannot find it in the URL you mentioned above.

Hello Albert,

I am sorry for the late notice. Yes, indeed, the current version contains train, validation, and test splits. I mixed up the links of the scripts. The ones with the error are ECtHR(https://github.com/coastalcph/lex-glue/blob/main/experiments/ecthr.py) and Unfair ToS(https://github.com/coastalcph/lex-glue/blob/main/experiments/unfair_tos.py). The snippet I shared was from one of them. I am unsure why there is that directory difference between the current dataset and the previous version or between the different LexGLUE tasks. I found the solution simply erasing the data_dir='data' argument from the load_dataset method. I can also try to communicate with the authors about the issue. I believe dataset directories or scripts need an update to avoid the error.

Thank you for your time.

Sign up or log in to comment