# How to build a multi-label & multi-class dataset correctly?

**URL:** <https://discuss.huggingface.co/t/how-to-build-a-multi-label-multi-class-dataset-correctly/76042>\
**Category:** Beginners\
**Created:** [March 5, 2024, 3:46pm UTC](https://discuss.huggingface.co/t/how-to-build-a-multi-label-multi-class-dataset-correctly/76042 "2024-03-05T15:46:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 15, 2025, 5:52am UTC](https://discuss.huggingface.co/t/how-to-build-a-multi-label-multi-class-dataset-correctly/76042/3 "2025-04-15T05:52:21Z")

</div>

This method?

> [@Creating a Sequence of ClassLabel for multi-label and multi-class problems](https://discuss.huggingface.co/t/creating-a-sequence-of-classlabel-for-multi-label-and-multi-class-problems/75724):
>
> Given a df with the following columns: text labels This is a sentence [0, 5, 3] I am unhappy [1, 9, 10] OR text labels1 label2 label3 This is a sentence 0 5 3 I am unhappy 1 9 10 How would one create a Dataset with the following structure of dataset.features: features = Features({ 'text': Value(dtype='string', id=None), 'labels': Sequence({ 'label1': ClassLabel(num\_classes=some\_number, names=some\_names, 'label2': ClassLabel(num\_classes=some\_nu…

---

_[View the full topic](https://discuss.huggingface.co/t/how-to-build-a-multi-label-multi-class-dataset-correctly/76042)._
