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

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadd-sequence-feature-classlabel-to-an-existing-dataset%2F17204%3E%5C
**Category:** 🤗Datasets\
**Created:** [April 26, 2022, 10:25am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadd-sequence-feature-classlabel-to-an-existing-dataset%2F17204 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Friccardobucco)%5C
**Post date:** [April 26, 2022, 10:25am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadd-sequence-feature-classlabel-to-an-existing-dataset%2F17204%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [May 2, 2022, 12:33pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadd-sequence-feature-classlabel-to-an-existing-dataset%2F17204%2F2 "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.
