Datasets:

Modalities:
Text
Formats:
arrow
ArXiv:
Libraries:
Datasets
License:

Unable to load the English and French portion of this dataset

#3
by oreva - opened

The parquet files for English and French seem to be missing, are there any plans to update them soon? The arrow files for these same languages also pose problems when trying to load the datset. There seems to be some inconsistency in the column names.

CIS, LMU Munich org

Hi,

We have arrow files for english and frnech:

english: https://huggingface.co/datasets/cis-lmu/Glot500/tree/main/eng_Latn/train
french: https://huggingface.co/datasets/cis-lmu/Glot500/tree/main/fra_Latn/train

Huggingface viewer just does not work very well.

Thanks for responding quickly. I am still unable to load the English and French portions. I consistently get this error below, and this is not the same csae with other languages. Are you able to reproduce the same error when you run this <load_dataset("cis-lmu/Glot500", "fra_Latn", cache_dir="cache")>

image.png

CIS, LMU Munich org

Hugging Face datasets are very high maintenance :)) It seems that if you use streaming mode, it works: https://github.com/huggingface/datasets/issues/3738
I did not try because not everybody wants to do streaming.

I just now tried it by specifying the split as 'train.'
Maybe the test and dev schemas are not the same as the train.
It is now downloading, but let's wait for the result.

The screenshot is from Google Colab.

Screenshot 2024-02-12 at 9.33.00 PM.png

Yeah, I did try to load it in "streaming" mode. It loads and throws the same error when I try to iterate through the data set. You are right, that there is a mismatch between the train and dev schemas. However, it's the same error regardless of the split I try to load.

Are there other ways to access the dataset beyond Hugging Face?

CIS, LMU Munich org

Got the same error.

Screenshot 2024-02-12 at 10.08.35 PM.png

@ayyoob-cis , can you help with this? Can we share it on another hosting platform or in another format?

Either way, the current version of the dataset is stored as Arrow. So, loading it with the Hugging Face datasets library would result in the same error.

I think we can download the data with a simple downloader if you are just looking for two languages; it should not be hard.

For example:

wget https://huggingface.co/datasets/cis-lmu/Glot500/resolve/main/eng_Latn/train/data-00000-of-00010.arrow

It downloads the very first part of the Arrow files in eng_Latn train. That's a little pain in ..., but I will ask the team for a better solution now.

sorry for the trouble and thanks for raising this issue.

I think downloading the Arrow files is the best workaround for me at the moment, hahaha. For future users, it would be great if there is a better solution. Thanks a lot for helping to troubleshoot.

For posterity, the below script would help convert the English and French train splits correctly, such that the data can be loaded at once.

from datasets import load_dataset, concatenate_datasets
from collections import Counter
from pathlib import Path

# in english train and french train folders
cwd = Path.cwd()
features = Counter()
datasets = []
for path in cwd.glob("*.arrow"):
    datasets.append(load_dataset("arrow", data_files={"train": str(path)}, split="train"))


col = "__index_level_0__" # erroneous extra column that affects some of the shards in English train (most likely also French)
datasets_ = []
for d in datasets:
    if col in d.features:
        d_ = d.remove_columns(col)
    else:
        d_ = d
    datasets_.append(d_)

dataset = concatenate_datasets(datasets_)

new_path = "YOUR_PATH"
dataset.save_to_disk(new_path)

fixed_dataset = load_dataset("arrow", data_files={"train": "./new/*.arrow"}, split="train")

Edit: now trying to load the entire dataset reveals that (process still ongoing) every third or fourth language has that issue.. I would kindly encourage the authors to reupload a loadable variant of this dataset.

CIS, LMU Munich org

Fixed for eng and fra.
I will look for other languages with the same issue and fix them.

ayyoob-cis changed discussion status to closed

Thanks!

I updated the issue on Github with a list of languages for which arrow files have the extra column name. The list should be comprehensive since my scripts backs up the original arrow files.

Sign up or log in to comment