# Passing schema features to a load\_dataset function

**URL:** <https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480>\
**Category:** 🤗Datasets\
**Created:** [August 25, 2021, 9:19pm UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480 "2021-08-25T21:19:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oigres](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@Oigres](https://discuss.huggingface.co/u/Oigres)\
**Post date:** [August 25, 2021, 9:19pm UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480/1 "2021-08-25T21:19:34Z")

</div>

Hi.

I am trying to load a loca csv into a Hugging Face dataset, but I have this error. I can’t understand what is wrong. I am using `dataset 1.6.2`

This is the code:

![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/0/0a4fb7f21a291c44ae961063ced18d5614590258.png)

And this is the error I have:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/5/502fbcf1acb22d6317784c269e914db66be42d22.png)

Tha error says `Target schema’s field names are not matching the table’s field names: [‘text’, ‘labels’, ‘offerid’], [‘labels’, ‘offerid’, ‘text’]. It doesn’t make any sense for me, because the fields name matches.

Any help would be welcome.

---

<div class="post-metadata">

**Author:** ![ayush488](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ayush488/32/2561_2.png) [@ayush488](https://discuss.huggingface.co/u/ayush488)\
**Post date:** [August 26, 2021, 7:59am UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480/2 "2021-08-26T07:59:13Z")

</div>

@Oigres Hi, Probably this [link](https://huggingface.co/docs/datasets/v1.6.2/loading_datasets.html) might help you, let me know if you have already tried.

---

<div class="post-metadata">

**Author:** ![Oigres](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@Oigres](https://discuss.huggingface.co/u/Oigres)\
**Post date:** [August 26, 2021, 10:36am UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480/3 "2021-08-26T10:36:42Z")

</div>

I find lot of information about how to work with datasets that come from the hub, like imbd. But, what I don’t find is how to work with your own datasets stored locally. Concretely, I have not seen any example about how to define the data types. In my case, I need to create manually the ClassLabel type, and I don’t find any example about how to do it.

---

<div class="post-metadata">

**Author:** ![Oigres](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@Oigres](https://discuss.huggingface.co/u/Oigres)\
**Post date:** [August 26, 2021, 12:02pm UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480/4 "2021-08-26T12:02:58Z")

</div>

Hi.

I finally found kind of a solution following this thread. Hope it can help others.

> [@Loading Custom Datasets](https://discuss.huggingface.co/t/loading-custom-datasets/6166/2):
>
> Hi ! The conll2003 script doesn’t parse json files, but rather text files in the conll format. This format has one line per token, with space-separated labels for the POS tag, the chunk tag and the NER tag. So if you want to use a dataset script like conll you’d have to use the right format, or reimplement the \_generate\_examples method to parse the json data (this should be straightforward since you just have to iterate over the json data and yield each example). Otherwise if you don’t want to…

---

<div class="post-metadata">

**Author:** ![ayush488](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ayush488/32/2561_2.png) [@ayush488](https://discuss.huggingface.co/u/ayush488)\
**Post date:** [August 26, 2021, 12:06pm UTC](https://discuss.huggingface.co/t/passing-schema-features-to-a-load-dataset-function/9480/5 "2021-08-26T12:06:13Z")

</div>

Wow, Great, Thanks for posting here
