# Add Sequence(feature=ClassLabel(...), ...) to an existing dataset

**URL:** <https://discuss.huggingface.co/t/add-sequence-feature-classlabel-to-an-existing-dataset/17204>\
**Category:** 🤗Datasets\
**Created:** [April 26, 2022, 10:25am UTC](https://discuss.huggingface.co/t/add-sequence-feature-classlabel-to-an-existing-dataset/17204 "2022-04-26T10:25:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardobucco](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@riccardobucco](https://discuss.huggingface.co/u/riccardobucco)\
**Post date:** [April 26, 2022, 10:25am UTC](https://discuss.huggingface.co/t/add-sequence-feature-classlabel-to-an-existing-dataset/17204/1 "2022-04-26T10:25:41Z")

</div>

I have a dataset (BIO tagging) with the following features:

```auto
{
    'words': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None),
    'word_labels': Sequence(feature=ClassLabel(num_classes=3, names=['B', 'I', 'O'], id=None), length=-1, id=None)
}

```

I preprocessed it with the `tokenize_and_align_labels` function that is provided [here](https://huggingface.co/course/chapter7/2?fw=pt#processing-the-data).

The new feature that is added to previous ones looks like this:

```auto
'labels': Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None)

```

Is there a way to get a `Sequence(feature=ClassLabel(...), ...)` instead? I’ve already tried to use `Dataset.class_encode_column`, but it doesn’t work with a `Sequence`. I’ve also tried to use `Dataset.cast_column` but it doesn’t work.

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [May 2, 2022, 12:33pm UTC](https://discuss.huggingface.co/t/add-sequence-feature-classlabel-to-an-existing-dataset/17204/2 "2022-05-02T12:33:05Z")

</div>

Hi! Sadly, I can’t reproduce the error. Could you please update your installation of `datasets` to the newest version with `pip install -U datasets` and run `dset.cast_column("labels", datasets.Sequence(datasets.ClassLabel(names=<labels>)))` again? In case it fails, please share the entire traceback with us.
