Handling unlabeled datasets
MEMBER
Hi @nelson-liu,

You can pass the parameter `features` to `load_dataset`: https://huggingface.co/docs/datasets/_modules/datasets/load.html#load_dataset

If you look at the code of the MNLI script you referred in your question (https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py#L62-L77), you can see how the Features were originally specified. 

Feel free to use it as a template, customize it and pass it to `load_dataset` using the parameter `features`.
2021-06-25T10:46:27Z
https://github.com/huggingface/datasets/issues/2549#issuecomment-868411178
https://api.github.com/repos/huggingface/datasets/issues/2549
MDEyOklzc3VlQ29tbWVudDg2ODQxMTE3OA==
https://api.github.com/repos/huggingface/datasets/issues/comments/868411178/reactions
2021-06-25T10:46:27Z
https://api.github.com/repos/huggingface/datasets/issues/comments/868411178
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
NONE
ah got it, thanks!
2021-06-25T21:07:56Z
https://github.com/huggingface/datasets/issues/2549#issuecomment-868834070
https://api.github.com/repos/huggingface/datasets/issues/2549
MDEyOklzc3VlQ29tbWVudDg2ODgzNDA3MA==
https://api.github.com/repos/huggingface/datasets/issues/comments/868834070/reactions
2021-06-25T21:07:56Z
https://api.github.com/repos/huggingface/datasets/issues/comments/868834070
https://avatars.githubusercontent.com/u/7272031?v=4
https://api.github.com/users/nelson-liu/events{/privacy}
https://api.github.com/users/nelson-liu/followers
https://api.github.com/users/nelson-liu/following{/other_user}
https://api.github.com/users/nelson-liu/gists{/gist_id}
https://github.com/nelson-liu
nelson-liu
MDQ6VXNlcjcyNzIwMzE=
https://api.github.com/users/nelson-liu/orgs
https://api.github.com/users/nelson-liu/received_events
https://api.github.com/users/nelson-liu/repos
https://api.github.com/users/nelson-liu/starred{/owner}{/repo}
https://api.github.com/users/nelson-liu/subscriptions
User
https://api.github.com/users/nelson-liu
public
Hi!

Is there a way for datasets to produce unlabeled instances (e.g., the `ClassLabel` can be nullable).

For example, I want to use the MNLI dataset reader ( https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py ) on a file that doesn't have the `gold_label` field. I tried setting `"label": data.get("gold_label")`, but got the following error:

```
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/load.py", line 748, in load_dataset
    use_auth_token=use_auth_token,
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 575, in download_and_prepare
    dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare
    self._prepare_split(split_generator, **prepare_split_kwargs)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 989, in _prepare_split
    example = self.info.features.encode_example(record)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 953, in encode_example
    return encode_nested_example(self, example)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in encode_nested_example
    k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in <dictcomp>
    k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 875, in encode_nested_example
    return schema.encode_example(obj)
  File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 653, in encode_example
    if not -1 <= example_data < self.num_classes:
TypeError: '<=' not supported between instances of 'int' and 'NoneType'
```

What's the proper way to handle reading unlabeled datasets, especially for downstream usage with Transformers?