SergeiGKS/huggingface-dataset-issues huggingface dataset:
Issue: muchocine dataset cannot be dowloaded

Comment:
I have encountered the same error with `v1.0.1` and `v1.0.2` on both Windows and Linux environments. However, cloning the repo and using the path to the dataset's root directory worked for me. Even after having the dataset cached - passing the path is the only way (for now) to load the dataset.

```python
from datasets import load_dataset

dataset = load_dataset("squad")                      # Works
dataset = load_dataset("code_search_net", "python")  # Error
dataset = load_dataset("covid_qa_deepset")           # Error

path = "/huggingface/datasets/datasets/{}/"
dataset = load_dataset(path.format("code_search_net"), "python")  # Works
dataset = load_dataset(path.format("covid_qa_deepset"))           # Works
```
Issue: muchocine dataset cannot be dowloaded

Comment:
Hi @mrm8488 and @amoux!
 The datasets you are trying to load have been added to the library during the community sprint for v2 last month. They will be available with the v2 release!
For now, there are still a couple of solutions to load the datasets:
1. As suggested by @amoux, you can clone the git repo and pass the local path to the script
2. You can also install the latest (master) version of `datasets` using pip: `pip install git+https://github.com/huggingface/datasets.git@master`
Issue: muchocine dataset cannot be dowloaded

Comment:
If you don't want to clone entire `datasets` repo, just download the `muchocine` directory and pass the local path to the directory. Cheers!
Issue: muchocine dataset cannot be dowloaded

Comment:
Muchocine was added recently, that's why it wasn't available yet.

To load it you can just update `datasets`
```
pip install --upgrade datasets
```

and then you can load `muchocine` with

```python
from datasets import load_dataset

dataset = load_dataset("muchocine", split="train")
```
Issue: bug with sst2 in glue 

Comment:
Maybe you can use nltk's treebank detokenizer ?
```python
from nltk.tokenize.treebank import TreebankWordDetokenizer

TreebankWordDetokenizer().detokenize("it 's a charming and often affecting journey . ".split())
# "it's a charming and often affecting journey."
```
Issue: bug with sst2 in glue 

Comment:
I don't know if there exists a detokenized version somewhere. Even the version on kaggle is tokenized
Issue: winogrande cannot be dowloaded 

Comment:
I have same issue for other datasets (`myanmar_news` in my case).

A version of `datasets` runs correctly on my local machine (**without GPU**) which looking for the dataset at 
```
https://raw.githubusercontent.com/huggingface/datasets/master/datasets/myanmar_news/myanmar_news.py
```

Meanwhile, other version runs on Colab (**with GPU**) failed to download the dataset. It try to find the dataset at `1.1.3` instead of `master` . If I disable GPU on my Colab, the code can load the dataset without any problem.

Maybe there is some version missmatch with the GPU and CPU version of code for these datasets?
Issue: winogrande cannot be dowloaded 

Comment:
It looks like they're two different issues

----------

First for `myanmar_news`: 

It must come from the way you installed `datasets`.
If you install `datasets` from source, then the `myanmar_news` script will be loaded from `master`.
However if you install from `pip` it will get it using the version of the lib (here `1.1.3`) and `myanmar_news` is not available in `1.1.3`.

The difference between your GPU and CPU executions must be the environment, one seems to have installed `datasets` from source and not the other.

----------

Then for `winogrande`:

The errors says that the url https://raw.githubusercontent.com/huggingface/datasets/1.1.3/datasets/winogrande/winogrande.py is not reachable.
However it works fine on my side.

Does your machine have an internet connection ? Are connections to github blocked by some sort of proxy ?
Can you also try again in case github had issues when you tried the first time ?
Issue: Inspecting datasets per category

Comment:
That's interesting, can you tell me what you think would be useful to access to inspect a dataset?

You can filter them in the hub with the search by the way: https://huggingface.co/datasets have you seen it?
Issue: Inspecting datasets per category

Comment:
Hi @thomwolf 
thank you, I was not aware of this, I was looking into the data viewer linked into readme page. 

This is exactly what I was looking for, but  this does not work currently, please see the attached 
I am selecting to see all nli datasets in english and it retrieves none. thanks

![5tarDHn9CP6ngeM](https://user-images.githubusercontent.com/53898419/103107612-1509aa80-4638-11eb-85b5-0c995a189969.png)
Issue: Inspecting datasets per category

Comment:
I see 4 results for NLI in English but indeed some are not tagged yet and missing (GLUE), we will focus on that in January (cc @yjernite): https://huggingface.co/datasets?filter=task_ids:natural-language-inference,languages:en
Issue: Inspecting datasets per category

Comment:
Hi! You can use `huggingface_hub`'s `list_datasets` for that now:
```python
import huggingface_hub # pip install huggingface_hub
huggingface_hub.list_datasets(filter="task_categories:question-answering")
# or
huggingface_hub.list_datasets(filter=("task_categories:natural-language-inference", "languages:"en"))
```
Issue: social_i_qa wrong format of labels

Comment:
@lhoestq, should I raise a PR for this? Just a minor change while reading labels text file
Issue: Adding UKP Argument Aspect Similarity Corpus

Comment:
Adding a link to the guide on adding a dataset if someone want to give it a try: https://github.com/huggingface/datasets#add-a-new-dataset-to-the-hub

we should add this guide to the issue template @lhoestq
Issue: Adding UKP Argument Aspect Similarity Corpus

Comment:
thanks @thomwolf , this is added now. The template is correct, sorry my mistake not to include it.
Issue: `Dataset.map` disable progress bar

Comment:
Progress bar can be disabled like this:
```python
from datasets.utils.logging import set_verbosity_error
set_verbosity_error()
```

There is this line in `Dataset.map`:
```python
not_verbose = bool(logger.getEffectiveLevel() > WARNING)
```

So any logging level higher than `WARNING` turns off the progress bar.
Issue: `Dataset.map` disable progress bar

Comment:
From the linked issues above, an up-to-date solution is:

```python
from datasets.utils.logging import disable_progress_bar
disable_progress_bar()
```

https://github.com/huggingface/datasets/blob/c6e08fcfc3a04e53430c26fa7c07da4cb18d977d/src/datasets/utils/logging.py#L233-L236
Issue: Cannot download ade_corpus_v2

Comment:
Hi @him1411, the dataset you are trying to load has been added during the community sprint and has not been released yet. It will be available with the v2 of `datasets`.
For now, you should be able to load the datasets after installing the latest (master) version of `datasets` using pip:
`pip install git+https://github.com/huggingface/datasets.git@master`
Issue: Cannot download ade_corpus_v2

Comment:
`ade_corpus_v2` was added recently, that's why it wasn't available yet.

To load it you can just update `datasets`
```
pip install --upgrade datasets
```

and then you can load `ade_corpus_v2` with

```python
from datasets import load_dataset

dataset = load_dataset("ade_corpus_v2", "Ade_corpos_v2_drug_ade_relation")
```

(looks like there is a typo in the configuration name, we'll fix it for the v2.0 release of `datasets` soon)
Issue: Can't filter language:EN on https://huggingface.co/datasets

Comment:
Cool @mapmeld ! My 2 cents (for a next iteration), it would be cool to have a small search widget in the filter dropdown as you have a ton of languages now here! Closing this in the meantime.
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Hi @SapirWeissbuch,
When you are saying it freezes, at that time it is unzipping the file from the zip file it downloaded. Since it's a very heavy file it'll take some time. It was taking ~11GB after unzipping when it started reading examples for me. Hope that helps!
![Screenshot 2020-12-21 at 23 40 52](https://user-images.githubusercontent.com/19718818/102808355-3b380c00-43e6-11eb-81ab-c31019ae6322.png)
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Hi @bhavitvyamalik 
Thanks for the reply!
Actually I let it run for 30 minutes before I killed the process. In this time, 30GB were extracted (much more than 11GB), I checked the size of the destination directory.

What version of Datasets are you using?
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
I'm using datasets version: 1.1.3. I think you should drop `cache_dir` and use only
`dataset = datasets.load_dataset("trivia_qa", "rc")`

Tried that on colab and it's working there too
![image](https://user-images.githubusercontent.com/19718818/102814269-4db74300-43f0-11eb-8f26-ecfcf4632002.png)
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Train, Validation, and Test splits contain 138384, 18669, and 17210 samples respectively. It takes some time to read the samples. Even in your colab notebook it was reading the samples before you killed the process. Let me know if it works now!
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Hi, it works on colab but it still doesn't work on my computer, same problem as before - overly large and long extraction process.
I have to use a custom 'cache_dir' because I don't have any space left in my home directory where it is defaulted, maybe this could be the issue?
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
I tried running this again - More details of the problem:
Code:
```
datasets.load_dataset("trivia_qa", "rc", cache_dir="/path/to/cache")
```

The output:
```
Downloading and preparing dataset trivia_qa/rc (download: 2.48 GiB, generated: 14.92 GiB, post-processed: Unknown size, total: 17.40 GiB) to path/to/cache/trivia_qa/rc/1.1.0/e734e28133f4d9a353af322aa52b9f266f6f27cbf2f072690a1694e577546b0d...                                                                          
Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.67G/2.67G [03:38<00:00, 12.2MB/s]

```
The process continues (no progress bar is visible).
I tried `du -sh .` in `path/to/cache`, and the size keeps increasing, reached 35G before I killed the process.

Google Colab with custom `cache_dir` has same issue.
https://colab.research.google.com/drive/1nn1Lw02GhfGFylzbS2j6yksGjPo7kkN-?usp=sharing#scrollTo=2G2O0AeNIXan
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
1) You can clear the huggingface folder in your `.cache` directory to use default directory for datasets. Speed of extraction and loading of samples depends a lot on your machine's configurations too.

2) I tried on colab `dataset = datasets.load_dataset("trivia_qa", "rc", cache_dir = "./datasets")`. After memory usage reached around 42GB (starting from 32GB used already), the dataset was loaded in the memory. Even Your colab notebook shows 
![image](https://user-images.githubusercontent.com/19718818/102852229-c7c4e780-4443-11eb-91d6-bf21024358a3.png)
which means it's loaded now.
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Facing the same issue.
I am able to download datasets without `cache_dir`, however, when I specify the `cache_dir`, the process hangs indefinitely after partial download. 
Tried for `data = load_dataset("cnn_dailymail", "3.0.0")`
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Hi @ashutoshml,
I tried this and it worked for me:
`data = load_dataset("cnn_dailymail", "3.0.0", cache_dir="./dummy")`

I'm using datasets==1.8.0. It took around 3-4 mins for dataset to unpack and start loading examples.
Issue: Bug: Can't download TriviaQA with `load_dataset` - custom `cache_dir`

Comment:
Ok. I waited for 20-30 mins, and it still is stuck.
I am using datasets==1.8.0.

Is there anyway to check what is happening? like a` --verbose` flag?

![Screenshot 2021-06-25 at 6 37 43 PM](https://user-images.githubusercontent.com/2375919/123429653-cdfb7280-d5e4-11eb-9fa7-ff295800cc86.png)
Issue: shuffle with torch generator 

Comment:
Is there a way one can convert the two generator? not sure overall what alternatives I could have to shuffle the datasets with a torch generator, thanks
Issue: shuffle with torch generator 

Comment:
@lhoestq  let me please expalin in more details, maybe you could help me suggesting an alternative to solve the issue for now, I have multiple large datasets using huggingface library, then I need to define a distributed sampler on top of it, for this I need to shard the datasets and give each shard to each core, but before sharding I need to shuffle the dataset, if you are familiar with distributed sampler in pytorch, this needs to be done based on seed+epoch generator to make it consistent across the cores they do it through defining a torch generator, I was wondering if you could tell me how I can shuffle the data for now, I am unfortunately blocked by this and have a limited time left, and I greatly appreciate your help on this. thanks
Issue: shuffle with torch generator 

Comment:
@lhoestq  Is there a way I could shuffle the datasets from this library with a custom defined shuffle function? thanks for your help on this.
Issue: shuffle with torch generator 

Comment:
Right now the shuffle method only accepts the `seed` (optional int) or `generator` (optional `np.random.Generator`) parameters.

Here is a suggestion to shuffle the data using your own shuffle method using `select`.
`select` can be used to re-order the dataset samples or simply pick a few ones if you want.
It's what is used under the hood when you call `dataset.shuffle`.

To use `select` you must have the list of re-ordered indices of your samples.

Let's say you have a `shuffle` methods that you want to use. Then you can first build your shuffled list of indices:
```python
shuffled_indices = shuffle(range(len(dataset)))
```

Then you can shuffle your dataset using the shuffled indices with 
```python
shuffled_dataset = dataset.select(shuffled_indices)
```

Hope that helps
Issue: shuffle with torch generator 

Comment:
thank you @lhoestq  thank you very much for responding to my question, this greatly helped me and remove the blocking for continuing my work, thanks.
Issue: shuffle with torch generator 

Comment:
@lhoestq  could you confirm the method proposed does not bring the whole data into memory? thanks
Issue: shuffle does not accept seed 

Comment:
Hi Thomas
thanks for reponse, yes, I did checked it, but this does not work for me please see 

```
(internship) rkarimi@italix17:/idiap/user/rkarimi/dev$ python 
Python 3.7.9 (default, Aug 31 2020, 12:42:55) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datasets 
2020-12-20 01:48:50.766004: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2020-12-20 01:48:50.766029: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> data = datasets.load_dataset("scitail", "snli_format")
cahce dir  /idiap/temp/rkarimi/cache_home_1/datasets
cahce dir  /idiap/temp/rkarimi/cache_home_1/datasets
Reusing dataset scitail (/idiap/temp/rkarimi/cache_home_1/datasets/scitail/snli_format/1.1.0/fd8ccdfc3134ce86eb4ef10ba7f21ee2a125c946e26bb1dd3625fe74f48d3b90)
>>> data.shuffle(seed=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: shuffle() got an unexpected keyword argument 'seed'

```

datasets version
`datasets                  1.1.2                     <pip>
`
Issue: shuffle does not accept seed 

Comment:
Thanks for reporting ! 

Indeed it looks like an issue with `suffle` on `DatasetDict`. We're going to fix that.
In the meantime you can shuffle each split (train, validation, test) separately:
```python
shuffled_train_dataset = data["train"].shuffle(seed=42)
```
Issue: Not able to use 'jigsaw_toxicity_pred' dataset

Comment:
Hi @jassimran,
The `jigsaw_toxicity_pred` dataset has not been released yet, it will be available with version 2 of `datasets`, coming soon.
You can still access it by installing the master (unreleased) version of datasets directly :
`pip install git+https://github.com/huggingface/datasets.git@master`
Please let me know if this helps
Issue: AttributeError: 'DatasetDict' object has no attribute 'train_test_split'

Comment:
Hi @david-waterworth!

As indicated in the error message, `load_dataset("csv")` returns a `DatasetDict` object, which is mapping of `str` to `Dataset` objects. I believe in this case the behavior is to return a `train` split with all the data.
`train_test_split` is a method of the `Dataset` object, so you will need to do something like this:
```python
dataset_dict = load_dataset(`'csv', data_files='data.txt')
dataset = dataset_dict['split name, eg train']
dataset.train_test_split(test_size=0.1)
```

Please let me know if this helps. 🙂
Issue: AttributeError: 'DatasetDict' object has no attribute 'train_test_split'

Comment:
Thanks, that's working - the same issue also tripped me up with training. 

I also agree https://github.com/huggingface/datasets/issues/767 would be a useful addition.
Issue: AttributeError: 'DatasetDict' object has no attribute 'train_test_split'

Comment:
> ```python
> dataset_dict = load_dataset(`'csv', data_files='data.txt')
> dataset = dataset_dict['split name, eg train']
> dataset.train_test_split(test_size=0.1)
> ```

I am getting error like
KeyError: 'split name, eg train'
Could you please tell me how to solve this?
Issue: AttributeError: 'DatasetDict' object has no attribute 'train_test_split'

Comment:
!curl -L "https://app.roboflow.com/ds/YQYgzFyKns?key=f0IwaEetrr" > roboflow.zip; unzip roboflow.zip; rm roboflow.zip

from datasets import load_dataset

dataset = load_dataset("imagefolder", data_dir="/content/")
dataset["train"][0]

dataset["train"][-1]

train_ds = load_dataset("imagefolder", data_dir="/content/train/")
test_ds = load_dataset("imagefolder", data_dir="/content/test/")
val_ds = load_dataset("imagefolder", data_dir="/content/valid/")

train_ds.features

and i got error 
AttributeError                            Traceback (most recent call last)
[<ipython-input-6-289222110c33>](https://localhost:8080/#) in <cell line: 1>()
----> 1 train_ds.features

AttributeError: 'DatasetDict' object has no attribute 'features'
Issue: connection error 

Comment:
This happen quite often when they are too many concurrent requests to github.

i can understand it’s a bit cumbersome to handle on the user side. Maybe we should try a few times in the lib (eg with timeout) before failing, what do you think @lhoestq ?
Issue: connection error 

Comment:
Hi @lhoestq thank you for the modification, I will use`script_version="master"` for now  :), to my experience, also setting timeout to a larger number like 3*60 which I normally use helps a lot on this.
Issue: Access to key in DatasetDict map

Comment:
Indeed that would be cool

Also FYI right now the easiest way to do this is
```python
dataset_dict["train"] = dataset_dict["train"].map(my_transform_for_the_train_set)
dataset_dict["test"] = dataset_dict["test"].map(my_transform_for_the_test_set)
```
Issue: Access to key in DatasetDict map

Comment:
I don't feel like adding an extra param for this simple usage makes sense, considering how many args `map` already has. 

(Feel free to re-open this issue if you don't agree with me)
Issue: Access to key in DatasetDict map

Comment:
I still think this is useful, since it's common that the data processing is different for training/dev/testing. And I don't know if the fact that `map` currently takes many arguments is a good reason not to support a useful feature.
Issue: IWSLT-17 Link Broken

Comment:
Sorry, this is a duplicate of #1287. Not sure why it didn't come up when I searched `iwslt` in the issues list.
Issue: Add helper to resolve namespace collision

Comment:
I was thinking about using something like [importlib](https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly) to over-ride the collision. 

**Reason requested**: I use the [following template](https://github.com/jramapuram/ml_base/) repo where I house all my datasets as a submodule.
Issue: Add helper to resolve namespace collision

Comment:
Alternatively huggingface could consider some submodule type structure like:

`import huggingface.datasets`
`import huggingface.transformers`

`datasets` is a very common module in ML and should be an end-user decision and not scope all of python ¯\_(ツ)_/¯
Issue: Add helper to resolve namespace collision

Comment:
It also wasn't initially obvious to me that the samples which contain `import datasets` were in fact importing a huggingface library (in fact all the huggingface imports are very generic - transformers, tokenizers, datasets...)
Issue: FileNotFoundError for `amazon_polarity`

Comment:
Hi @phtephanx , the `amazon_polarity` dataset has not been released yet. It will be available in the coming soon v2of `datasets` :) 

You can still access it now if you want, but you will need to install datasets via the master branch:
`pip install git+https://github.com/huggingface/datasets.git@master`
Issue: Installing datasets and transformers in a tensorflow docker image throws Permission Error on 'import transformers'

Comment:
Thanks for reporting !
You can override the directory in which cache file are stored using for example
```
ENV HF_HOME="/root/cache/hf_cache_home"
```

This way both `transformers` and `datasets` will use this directory instead of the default `.cache`
Issue: Installing datasets and transformers in a tensorflow docker image throws Permission Error on 'import transformers'

Comment:
> Thanks for reporting !
> You can override the directory in which cache file are stored using for example
> 
> ```
> ENV HF_HOME="/root/cache/hf_cache_home"
> ```
> 
> This way both `transformers` and `datasets` will use this directory instead of the default `.cache`

can we disable caching directly?
Issue: Installing datasets and transformers in a tensorflow docker image throws Permission Error on 'import transformers'

Comment:
Hi ! Unfortunately no since we need this directory to load datasets.
When you load a dataset, it downloads the raw data files in the cache directory inside <cache_dir>/downloads. Then it builds the dataset and saves it as arrow data inside <cache_dir>/<dataset_name>.

However you can specify the directory of your choice, and it can be a temporary directory if you want to clean everything up at one point.
Issue: connection issue while downloading data

Comment:
could you tell me how I can avoid download, by pre-downloading the data first, put them in a folder so the code does not try to redownload? could you tell me the path to put the downloaded data, and how to do it? thanks
@lhoestq
Issue: connection issue while downloading data

Comment:
Does your instance have an internet connection ?

If you don't have an internet connection you'll need to have the dataset on the instance disk.
To do so first download the dataset on another machine using `load_dataset` and then you can save it in a folder using `my_dataset.save_to_disk("path/to/folder")`. Once the folder is copied on your instance you can reload the dataset with `datasets.load_from_disk("path/to/folder")`
Issue: how to get all the options of a property in datasets 

Comment:
In a dataset, labels correspond to the `ClassLabel` feature that has the `names` property that returns string represenation of the integer classes (or `num_classes` to get the number of different classes).