Cannot load `few-nerd` dataset
MEMBER
Hi @Mehrad0711,

I'm afraid there is no "canonical" Hugging Face dataset named "few-nerd".

There are 2 kinds of datasets hosted at the Hugging Face Hub:
- canonical datasets (their identifier contains no slash "/"): we, the Hugging Face team, supervise their implementation and we make sure they work correctly by means of our test suite
- community datasets (their identifier contains a slash "/", where before the slash it is the username or the organization name): those datasets are uploaded to the Hub by the community, and we, the Hugging Face team, do not supervise them; it is the responsibility of the user/organization implementing them properly if they want them to be used by other users.

In this specific case, there is no "canonical" dataset named "few-nerd". On the other hand, there are two "community" datasets named "few-nerd":
- ["nbroad/few-nerd"](https://huggingface.co/datasets/nbroad/few-nerd)
- ["dfki-nlp/few-nerd"](https://huggingface.co/datasets/dfki-nlp/few-nerd)

If they were properly implemented, you should be able to load them this way:
```python
# "nbroad/few-nerd" community dataset
ds = load_dataset("nbroad/few-nerd", "supervised")

# "dfki-nlp/few-nerd" community dataset
ds = load_dataset("dfki-nlp/few-nerd", "supervised")
```

However, they are not correctly implemented and both of them give errors:
- "nbroad/few-nerd":
  ```
  TypeError: expected str, bytes or os.PathLike object, not dict
  ```
- "dfki-nlp/few-nerd":
  ```
  ConnectionError: Couldn't reach https://cloud.tsinghua.edu.cn/f/09265750ae6340429827/?dl=1
  ```

You could try to contact their users/organizations to inform them about their bugs and ask them if they are planning to fix them. Alternatively you could try to implement your own script for this dataset.
2021-08-03T05:35:43Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-891543824
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps41I-EQ
https://api.github.com/repos/huggingface/datasets/issues/comments/891543824/reactions
2021-08-03T05:35:43Z
https://api.github.com/repos/huggingface/datasets/issues/comments/891543824
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
Thanks @albertvillanova for your detailed explanation! I will resort to my own scripts for now. 
2021-08-03T19:45:43Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-892116709
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps41LJ7l
https://api.github.com/repos/huggingface/datasets/issues/comments/892116709/reactions
2021-08-03T19:45:43Z
https://api.github.com/repos/huggingface/datasets/issues/comments/892116709
https://avatars.githubusercontent.com/u/28717374?v=4
https://api.github.com/users/Mehrad0711/events{/privacy}
https://api.github.com/users/Mehrad0711/followers
https://api.github.com/users/Mehrad0711/following{/other_user}
https://api.github.com/users/Mehrad0711/gists{/gist_id}
https://github.com/Mehrad0711
Mehrad0711
MDQ6VXNlcjI4NzE3Mzc0
https://api.github.com/users/Mehrad0711/orgs
https://api.github.com/users/Mehrad0711/received_events
https://api.github.com/users/Mehrad0711/repos
https://api.github.com/users/Mehrad0711/starred{/owner}{/repo}
https://api.github.com/users/Mehrad0711/subscriptions
User
https://api.github.com/users/Mehrad0711
public
NONE
Hello, @Mehrad0711; Hi, @albertvillanova  !
I am the maintainer of the `dfki/few-nerd" dataset script, sorry for the very late reply and hope this message finds you well!
We should use
```
dataset = load_dataset("dfki-nlp/few-nerd", name="supervised")
```
instead of not specifying the "name" argument, where name is from `["supervised", "inter", "intra"]`. Otherwise the method just treats "supervised" as `split`, which we reserve after specifying the name, since for each name, there are three splits: train, dev and test.

Also we use Tsinghua server source to download data files since it is the official source referred in the paper where the dataset is released (even though it is cc-by-sa-4.0 licensed, means we can copy the data anywhere after mentioning the license
). Sometimes the server just runs down due to high pressure, kinda weird (we encountered the same server problem serveral times a month when we conducted experiments on Few-NERD XD). I tried the script just now and it works perfectly!
```
>> dataset
DatasetDict({
    train: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 131767
    })
    validation: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 18824
    })
    test: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 37648
    })
})
>>> dataset["train"]
Dataset({
    features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
    num_rows: 131767
})
>>> dataset["train"][0]
{'id': '0', 'tokens': ['Paul', 'International', 'airport', '.'], 'ner_tags': [0, 0, 0, 0], 'fine_ner_tags': [0, 0, 0, 0]}
```
Anyways if you cannot stand the pain with the server and its slow download speed, you can also download the `dfki/few-nerd.py` script from HF and change the `_URLs` to your personal drive (after you once successfully download the data and upload to your cloud drive), and then load the .py script locally.

Hope this reply can still be any help. If you still have problems with it, feel free to ask here and I am glad to help!
Best wishes.
2021-11-15T07:29:52Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-968608376
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps45u8p4
https://api.github.com/repos/huggingface/datasets/issues/comments/968608376/reactions
2021-11-15T07:55:21Z
https://api.github.com/repos/huggingface/datasets/issues/comments/968608376
https://avatars.githubusercontent.com/u/42862848?v=4
https://api.github.com/users/chen-yuxuan/events{/privacy}
https://api.github.com/users/chen-yuxuan/followers
https://api.github.com/users/chen-yuxuan/following{/other_user}
https://api.github.com/users/chen-yuxuan/gists{/gist_id}
https://github.com/chen-yuxuan
chen-yuxuan
MDQ6VXNlcjQyODYyODQ4
https://api.github.com/users/chen-yuxuan/orgs
https://api.github.com/users/chen-yuxuan/received_events
https://api.github.com/users/chen-yuxuan/repos
https://api.github.com/users/chen-yuxuan/starred{/owner}{/repo}
https://api.github.com/users/chen-yuxuan/subscriptions
User
https://api.github.com/users/chen-yuxuan
public
MEMBER
Hi @chen-yuxuan, thanks for your answer.

Just a few comments:

- Please, note that as we use `datasets.load_dataset` implementation, we can pass the configuration name as the second positional argument (no need to pass explicitly `name=`) and it downloads the 3 splits:
```python
  In [4]: ds = load_dataset("dfki-nlp/few-nerd", "supervised")
Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11.5k/11.5k [00:00<00:00, 2.85MB/s]
Downloading and preparing dataset few_nerd/supervised to .cache\huggingface\datasets\dfki-nlp___few_nerd\supervised\0.0.0\e40882b71f037a4a1f232025899170fbe8113cd2f4a26dddd2add7222a077255...
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6M/14.6M [01:16<00:00, 190kB/s]
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11.9M/11.9M [01:14<00:00, 160kB/s]
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12.0M/12.0M [01:04<00:00, 186kB/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [03:58<00:00, 79.45s/it]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00,  3.11it/s]
```

- On the other hand, please note that your script does not work on Windows machines, because you call `open()` without passing the encoding parameter:
```
~\.cache\huggingface\modules\datasets_modules\datasets\dfki-nlp___few-nerd\e40882b71f037a4a1f232025899170fbe8113cd2f4a26dddd2add7222a077255\few-nerd.py in <genexpr>(.0)
    276         assert filepath[-4:] == ".txt"
    277
--> 278         num_lines = sum(1 for _ in open(filepath))
    279         id = 0
    280

.venv\lib\encodings\cp1252.py in decode(self, input, final)
     21 class IncrementalDecoder(codecs.IncrementalDecoder):
     22     def decode(self, input, final=False):
---> 23         return codecs.charmap_decode(input,self.errors,decoding_table)[0]
     24
     25 class StreamWriter(Codec,codecs.StreamWriter):

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 5238: character maps to <undefined>
```

If you would like your script to be usable on Windows machines, you should pass `encoding="utf-8"` to every `open()` function:
- line 278: `num_lines = sum(1 for _ in open(filepath, encoding="utf-8"))`
- line 281: `with open(filepath, "r", encoding="utf-8")`
2021-11-15T08:24:15Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-968643841
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps45vFUB
https://api.github.com/repos/huggingface/datasets/issues/comments/968643841/reactions
2021-11-15T08:24:15Z
https://api.github.com/repos/huggingface/datasets/issues/comments/968643841
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
Thank you @albertvillanova for your detailed feedback!

> no need to pass explicitly `name=`

Good catch! I thought `split` stands before `name` in the argument list... but now it is all clear to me, sounds cool! Thanks for the explanation.

Anyways in our old code it still looks bit confusing if we only want one split but the function downloads all, so to allow efficient downloading, I optimized the code a bit so that only the specified split data is downloaded. now we get
```
>>> x = load_dataset("dfki-nlp/few-nerd", "supervised")
Downloading and preparing dataset few_nerd/supervised to /home/user/.cache/huggingface/datasets/few_nerd/supervised/0.0.0/8e7ab598946cd5b395dcec6ea239123c8dff5b58b8e1c03b0c595b540248a885...
Downloading: 100%|███████████████████████████████████████████████████████████████████| 14.6M/14.6M [01:01<00:00, 238kB/s]
100%|██████████████████████████████████████████████████████████████████████| 3359329/3359329 [00:12<00:00, 275462.84it/s]
100%|████████████████████████████████████████████████████████████████████████| 482037/482037 [00:01<00:00, 278633.64it/s]
100%|████████████████████████████████████████████████████████████████████████| 958765/958765 [00:03<00:00, 267472.83it/s]
Dataset few_nerd downloaded and prepared to /home/user/.cache/huggingface/datasets/few_nerd/supervised/0.0.0/8e7ab598946cd5b395dcec6ea239123c8dff5b58b8e1c03b0c595b540248a885. Subsequent calls will reuse this data.
```
where only one progress bar indicates downloading, and the three others just indicate pre-processing for the train, dev, test set.

For the encoding issue, I have made corresponding changes for the two lines you pointed out. However, I have no windows machine at hand, I would really appreciate it if you could help test on your end.

All the updates are uploaded to HF under `dfki-nlp` account where I am working for. 
Thank you again for your kind help!

2021-11-15T10:00:01Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-968723268
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps45vYtE
https://api.github.com/repos/huggingface/datasets/issues/comments/968723268/reactions
2021-11-15T11:48:51Z
https://api.github.com/repos/huggingface/datasets/issues/comments/968723268
https://avatars.githubusercontent.com/u/42862848?v=4
https://api.github.com/users/chen-yuxuan/events{/privacy}
https://api.github.com/users/chen-yuxuan/followers
https://api.github.com/users/chen-yuxuan/following{/other_user}
https://api.github.com/users/chen-yuxuan/gists{/gist_id}
https://github.com/chen-yuxuan
chen-yuxuan
MDQ6VXNlcjQyODYyODQ4
https://api.github.com/users/chen-yuxuan/orgs
https://api.github.com/users/chen-yuxuan/received_events
https://api.github.com/users/chen-yuxuan/repos
https://api.github.com/users/chen-yuxuan/starred{/owner}{/repo}
https://api.github.com/users/chen-yuxuan/subscriptions
User
https://api.github.com/users/chen-yuxuan
public
MEMBER
Hi @chen-yuxuan,

I have tested on Windows and now it works perfectly, after the fixing of the encoding issue:
```python
In [1]: from datasets import load_dataset

In [2]: ds = load_dataset("dfki-nlp/few-nerd", "supervised")
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11.5k/11.5k [00:00<?, ?B/s]
Downloading and preparing dataset few_nerd/supervised to C:\Users\username\.cache\huggingface\datasets\dfki-nlp___few_nerd\supervised\0.0.0\e1ceeaee82073fea12206e4461c7cfcd67e68c8f3ebeca179bddcacee00c4511...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3359329/3359329 [00:25<00:00, 129427.23it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 482037/482037 [00:03<00:00, 134513.66it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 958765/958765 [00:06<00:00, 143152.35it/s]
Dataset few_nerd downloaded and prepared to C:\Users\username\.cache\huggingface\datasets\dfki-nlp___few_nerd\supervised\0.0.0\e1ceeaee82073fea12206e4461c7cfcd67e68c8f3ebeca179bddcacee00c4511. Subsequent calls will reuse this data.765 [00:06<00:00, 139045.03it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 174.71it/s]

In [3]: ds
Out[3]:
DatasetDict({
    train: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 131767
    })
    validation: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 18824
    })
    test: Dataset({
        features: ['id', 'tokens', 'ner_tags', 'fine_ner_tags'],
        num_rows: 37648
    })
})
```
2021-11-16T08:51:34Z
https://github.com/huggingface/datasets/issues/2746#issuecomment-970053160
https://api.github.com/repos/huggingface/datasets/issues/2746
IC_kwDODunzps450dYo
https://api.github.com/repos/huggingface/datasets/issues/comments/970053160/reactions
2021-11-16T08:51:34Z
https://api.github.com/repos/huggingface/datasets/issues/comments/970053160
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
## Describe the bug

Cannot load `few-nerd` dataset.

## Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('few-nerd', 'supervised')
```

## Actual results

Executing above code will give the following error:

```
Using the latest cached version of the module from /Users/Mehrad/.cache/huggingface/modules/datasets_modules/datasets/few-nerd/62464ace912a40a0f33a11a8310f9041c9dc3590ff2b3c77c14d83ca53cfec53 (last modified on Wed Jun  2 11:34:25 2021) since it couldn't be found locally at /Users/Mehrad/Documents/GitHub/genienlp/few-nerd/few-nerd.py, or remotely (FileNotFoundError).
Downloading and preparing dataset few_nerd/supervised (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /Users/Mehrad/.cache/huggingface/datasets/few_nerd/supervised/0.0.0/62464ace912a40a0f33a11a8310f9041c9dc3590ff2b3c77c14d83ca53cfec53...
Traceback (most recent call last):
  File "/Users/Mehrad/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare
    self._prepare_split(split_generator, **prepare_split_kwargs)
  File "/Users/Mehrad/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py", line 1107, in _prepare_split
    disable=bool(logging.get_verbosity() == logging.NOTSET),
  File "/Users/Mehrad/opt/anaconda3/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
    for obj in iterable:
  File "/Users/Mehrad/.cache/huggingface/modules/datasets_modules/datasets/few-nerd/62464ace912a40a0f33a11a8310f9041c9dc3590ff2b3c77c14d83ca53cfec53/few-nerd.py", line 196, in _generate_examples
    with open(filepath, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/Mehrad/.cache/huggingface/datasets/downloads/supervised/train.json'
```
The bug is probably in identifying and downloading the dataset. If I download the json splits directly from [link](https://github.com/nbroad1881/few-nerd/tree/main/uncompressed) and put them under the downloads directory, they will be processed into arrow format correctly. 

## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.11.0
- Python version: 3.8
- PyArrow version: 1.0.1
