Hi ! You can define a Sequence of ClassLabel with
Sequence(ClassLabel(names=...))

but in this case you need your data to be integers, not strings.
You can convert your data to integers with
data = features.encode_batch(data)

and then get your dataset:
dt = Dataset.from_dict(data, features=features)

Regarding the label2id of DistilBERT, you can define your own by specifying the id2label parameter of the model config when you load your model with .from_pretrained(..., id2label=...)



 zhcr:

the function align_labels_with_mapping crashes when the feature is a Sequence, and casting the feature also was not able to cast the values inside the Sequence object.


Could you open an issue on GitHub so that we can take a look into what went wrong ?
If you have a code snippet that reproduces the error that would be of great help as well.