ClassLabels when using push_to_hub


Congrats on this amazing library.

I am uploading a dataset programmatically using push_to_hub and defining the features as follows:

# ds contains text and label strings
hf_ds = Dataset.from_dict(
        "text": Value("string"),
        "label": ClassLabel(names=['World', 'Sports', ..])

The thing is that even if I see the ClassLabel feature when I do hf_ds.features. The result on the dataset preview shows the labels as int and seems to indicate they’ve been given the int type.

Is there something I’m doing wrong on my side?

For reference this is the dataset: Recognai/corrected_labels_ag_news · Datasets at Hugging Face

Sorry I’ve seen this has already been tackled here:

1 Like