SergeiGKS/huggingface-dataset-issues huggingface dataset:
Issue: Error in loading the Arabic Billion Words Corpus

Comment:
I modified the dataset loading script to catch the `IndexError` and inspect the records at which the error is happening, and I found this:
For the `Techreen` config, the error happens in 36 records when trying to find the `Text` or `Dateline` tags. All these 36 records look something like:
```
<Techreen>
 <ID>TRN_ARB_0248167</ID>
 <URL>http://tishreen.news.sy/tishreen/public/read/248240</URL>
 <Headline>Removed, because the original articles was in English</Headline>
</Techreen>
```

and all the 288 faulty records in the `Almustaqbal` config look like:
```
<Almustaqbal>
 <ID>MTL_ARB_0028398</ID>
 
 <URL>http://www.almustaqbal.com/v4/article.aspx?type=NP&ArticleID=179015</URL>
 <Headline> Removed because it is not available in the original site</Headline>
</Almustaqbal>
```

so the error is happening because the articles were removed and so the associated records lack the `Text` tag.

In this case, I think we just need to catch the `IndexError` and ignore (pass) it.
Issue: Error in loading the Arabic Billion Words Corpus

Comment:
Thanks @M-Salti for reporting this issue and for your investigation.

Indeed, those `IndexError` should be catched and the corresponding record should be ignored.

I'm opening a Pull Request to fix it.
Issue: 404 Error when loading remote data files from private repo

Comment:
I guess the issue is when computing the ETags of the remote files. Indeed `use_auth_token` must be passed to `request_etags` here:

https://github.com/huggingface/datasets/blob/35b5e4bc0cb2ed896e40f3eb2a4aa3de1cb1a6c5/src/datasets/builder.py#L160-L160
Issue: 404 Error when loading remote data files from private repo

Comment:
Yes, I remember having properly implemented that: 
- https://github.com/huggingface/datasets/commit/7a9c62f7cef9ecc293f629f859d4375a6bd26dc8#diff-f933ce41f71c6c0d1ce658e27de62cbe0b45d777e9e68056dd012ac3eb9324f7R160
- https://github.com/huggingface/datasets/pull/2628/commits/6350a03b4b830339a745f7b1da46ece784ca734c

But a subsequent refactoring accidentally removed it...
Issue: Missing cache file

Comment:
This could be solved by going to the glue/ directory and delete sst2 directory, then load the dataset again will help you redownload the dataset.
Issue: Missing cache file

Comment:
Hi ! Not sure why this file was missing, but yes the way to fix this is to delete the sst2 directory and to reload the dataset
Issue: Calling shuffle on IterableDataset will disable batching in case any functions were mapped

Comment:
Hi :) Good catch ! Feel free to open a PR if you want to contribute, this would be very welcome ;)
Issue: add more precise information for size

Comment:
We already have this information in the dataset_infos.json files of each dataset.
Maybe we can parse these files in the backend to return their content with the endpoint at huggingface.co/api/datasets

For now if you want to access this info you have to load the json for each dataset. For example:
- for a dataset on github like `squad` 
-   https://raw.githubusercontent.com/huggingface/datasets/master/datasets/squad/dataset_infos.json
- for a community dataset on the hub like `lhoestq/squad`:
  https://huggingface.co/datasets/lhoestq/squad/resolve/main/dataset_infos.json
Issue: Missing documentation for wnut_17 (ner_tags)

Comment:
Hi @maxpel, thanks for reporting this issue.

Indeed, the documentation in the dataset card is not complete. I’m opening a Pull Request to fix it.

As the paper explains, there are 6 entity types and we have ordered them alphabetically: `corporation`, `creative-work`, `group`, `location`, `person` and `product`. 

Each of these entity types has 2 possible IOB2 format tags: 
- `B-`: to indicate that the token is the beginning of an entity name, and the 
- `I-`: to indicate that the token is inside an entity name. 

Additionally, there is the standalone IOB2 tag 
- `O`: that indicates that the token belongs to no named entity. 

In total there are 13 possible tags, which correspond to the following integer numbers:

0. `O`
1. `B-corporation`
2. `I-corporation`
3. `B-creative-work`
4. `I-creative-work`
5. `B-group`
6. `I-group`
7. `B-location`
8. `I-location`
9. `B-person`
10. `I-person`
11. `B-product`
12. `I-product`
Issue: 404 Not Found Error when loading LAMA dataset

Comment:
Hi @dwil2444! I was able to reproduce your error when I downgraded to v1.1.2. Updating to the latest version of Datasets fixed the error for me :)
Issue: 404 Not Found Error when loading LAMA dataset

Comment:
Hi @dwil2444, thanks for reporting.

Could you please confirm which `datasets` version you were using and if the problem persists after you update it to the latest version: `pip install -U datasets`?

Thanks @stevhliu for the hint to fix this! ;)
Issue: 404 Not Found Error when loading LAMA dataset

Comment:
@stevhliu @albertvillanova  updating to the latest version of datasets did in fact fix this issue. Thanks a lot for your help!
Issue: 404 not found error on loading WIKIANN dataset

Comment:
Hi @ronbutan, thanks for reporting.

You are right: we have recently found that the link to the original PAN-X dataset (also called WikiANN), hosted at Dropbox, is no longer working.

We have opened an issue in the GitHub repository of the original dataset (afshinrahimi/mmner#4) and we have also contacted the author by email to ask if they are planning to fix this issue. See the details here: https://github.com/huggingface/datasets/issues/2691#issuecomment-885463027

I close this issue because it is the same as in #2691. Feel free to subscribe to that other issue to be informed about any updates.
Issue: from datasets import Dataset is failing 

Comment:
Hi @kswamy15, thanks for reporting.

We are fixing this critical issue and making an urgent patch release of the `datasets` library today.

In the meantime, you can circumvent this issue by updating the `tqdm` library: `!pip install -U tqdm`
Issue: cannot combine splits merging and streaming?

Comment:
Hi ! That's missing indeed. We'll try to implement this for the next version :)

I guess we just need to implement #2564 first, and then we should be able to add support for splits combinations
Issue: Cannot import load_dataset on Colab

Comment:
I'm facing the same issue on Colab today too.

```
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-5833ac0f5437> in <module>()
      3 
      4 from ray import tune
----> 5 from datasets import DatasetDict, Dataset
      6 from datasets import load_dataset, load_metric
      7 from dataclasses import dataclass

7 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in <module>()
     25 import posixpath
     26 import requests
---> 27 from tqdm.contrib.concurrent import thread_map
     28 
     29 from .. import __version__, config, utils

ModuleNotFoundError: No module named 'tqdm.contrib.concurrent'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
```
Issue: Cannot import load_dataset on Colab

Comment:
@phosseini 
I think it is related to [1.10.0](https://github.com/huggingface/datasets/actions/runs/1052653701) release done 3 hours ago. (cc: @lhoestq )
For now I just downgraded to 1.9.0 and it is working fine.
Issue: Cannot import load_dataset on Colab

Comment:
> @phosseini
> I think it is related to [1.10.0](https://github.com/huggingface/datasets/actions/runs/1052653701) release done 3 hours ago. (cc: @lhoestq )
> For now I just downgraded to 1.9.0 and it is working fine.

Same here, downgraded to 1.9.0 for now and works fine.
Issue: Cannot import load_dataset on Colab

Comment:
Hi, 

updating tqdm to the newest version resolves the issue for me. You can do this as follows in Colab:
```
!pip install tqdm --upgrade
```
Issue: Cannot import load_dataset on Colab

Comment:
Hi @bayartsogt-ya and @phosseini, thanks for reporting.

We are fixing this critical issue and making an urgent patch release of the `datasets` library today.

In the meantime, as pointed out by @mariosasko, you can circumvent this issue by updating the `tqdm` library: 
```
!pip install -U tqdm
```
Issue: xtreme / pan-x cannot be downloaded

Comment:
Hi @severo, thanks for reporting.

However I have not been able to reproduce this issue. Could you please confirm if the problem persists for you?

Maybe Dropbox (where the data source is hosted) was temporarily unavailable when you tried.
Issue: xtreme / pan-x cannot be downloaded

Comment:
Hmmm, the file (https://www.dropbox.com/s/dl/12h3qqog6q4bjve/panx_dataset.tar) really seems to be unavailable... I tried from various connexions and machines and got the same 404 error. Maybe the dataset has been loaded from the cache in your case?
Issue: xtreme / pan-x cannot be downloaded

Comment:
Yes @severo, weird... I could access the file when I answered to you, but now I cannot longer access it either... Maybe it was from the cache as you point out.

Anyway, I have opened an issue in the GitHub repository responsible for the original dataset: https://github.com/afshinrahimi/mmner/issues/4
I have also contacted the maintainer by email.

I'll keep you informed with their answer.
Issue: xtreme / pan-x cannot be downloaded

Comment:
Reply from the author/maintainer: 
> Will fix the issue and let you know during the weekend.
Issue: xtreme / pan-x cannot be downloaded

Comment:
The author told that apparently Dropbox has changed their policy and no longer allow downloading the file without having signed in first. The author asked Hugging Face to host their dataset.
Issue: cannot save the dataset to disk after rename_column

Comment:
Hi ! That's because you are trying to overwrite a file that is already open and being used.
Indeed `foo/dataset.arrow` is open and used by your `dataset` object.

When you do `rename_column`, the resulting dataset reads the data from the same arrow file.
In other cases like when using `map` on the other hand, the resulting dataset reads the data from another arrow file that is the result of the map transform.

Therefore overwriting a dataset after `rename_column` is not possible, but it is possible after `map`, since `rename_column` doesn't switch to using another arrow file (the actual data stay the same).
Issue: hebrew language codes he and iw should be treated as aliases

Comment:
Hi @eyaler, thanks for reporting.

While you are true with respect the Hebrew language tag ("iw" is deprecated and "he" is the preferred value), in the "mc4" dataset (which is a derived dataset) we have kept the language tags present in the original dataset: [Google C4](https://www.tensorflow.org/datasets/catalog/c4).
Issue: hebrew language codes he and iw should be treated as aliases

Comment:
For discoverability on the website I updated the YAML tags at the top of the mC4 dataset card https://github.com/huggingface/datasets/commit/38288087b1b02f97586e0346e8f28f4960f1fd37

Once the website is updated, mC4 will be listed in https://huggingface.co/datasets?filter=languages:he
Issue: 5 duplicate datasets

Comment:
Yes this was documented in the PR that added this hf->paperswithcode mapping (https://github.com/huggingface/datasets/pull/2404) and AFAICT those are slightly distinct datasets so I think it's a wontfix

For context on the paperswithcode mapping you can also refer to https://github.com/huggingface/huggingface_hub/pull/43 which contains a lot of background discussion
Issue: Cannot load the blog_authorship_corpus due to codec errors

Comment:
Hi @izaskr, thanks for reporting.

However the traceback you joined does not correspond to the codec error message: it is about other error `NonMatchingSplitsSizesError`. Maybe you missed some important part of your traceback...

I'm going to have a look at the dataset anyway...
Issue: Cannot load the blog_authorship_corpus due to codec errors

Comment:
Hi @izaskr, thanks again for having reported this issue.

After investigation, I have created a Pull Request (#2685) to fix several issues with this dataset:
- the `NonMatchingSplitsSizesError`
- the `UnicodeDecodeError`

Once the Pull Request merged into master, you will be able to load this dataset if you install `datasets` from our GitHub repository master branch. Otherwise, you will be able to use it after our next release, by updating `datasets`: `pip install -U datasets`.
Issue: Cannot load the blog_authorship_corpus due to codec errors

Comment:
@albertvillanova 
Can you shed light on how this fix works?

We're experiencing a similar issue. 

If we run several runs (eg in a Wandb sweep) the first run "works" but then we get `NonMatchingSplitsSizesError`

| run num | actual train examples # | expected example # | recorded example # |
| ------- | -------------- | ----------------- | -------- |
| 1       | 100            | 100               | 100      |
| 2       | 102            | 100               | 102      |
| 3       | 100            | 100               | 202      | 
| 4       | 40             | 100               | 40       |
| 5       | 40             | 100               | 40       |
| 6       | 40             | 100               | 40       | 


The second through the nth all crash with 

```
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=19980970, num_examples=100, dataset_name='cies'), 'recorded': SplitInfo(name='train', num_bytes=40163811, num_examples=202, dataset_name='cies')}]

```
Issue: Import Error in Kaggle notebook

Comment:
You may need to restart your kaggle notebook after installing a newer version of `pyarrow`.

If it doesn't work we'll probably have to create an issue on [arrow's JIRA](https://issues.apache.org/jira/projects/ARROW/issues/), and maybe ask kaggle why it could fail
Issue: Import Error in Kaggle notebook

Comment:
> You may need to restart your kaggle notebook before after installing a newer version of `pyarrow`.
> 
> If it doesn't work we'll probably have to create an issue on [arrow's JIRA](https://issues.apache.org/jira/projects/ARROW/issues/), and maybe ask kaggle why it could fail

It works after restarting.
My bad, I forgot to restart the notebook. Sorry for the trouble!
Issue: Error when downloading C4

Comment:
Hi Thanks for reporting !
It looks like these files are not correctly reported in the list of expected files to download, let me fix that ;)
Issue: Error when downloading C4

Comment:
Alright this is fixed now. We'll do a new release soon to make the fix available.

In the meantime feel free to simply pass `ignore_verifications=True` to `load_dataset` to skip this error
Issue: Metric kwargs are not passed to underlying external metric f1_score

Comment:
Hi @BramVanroy, thanks for reporting.

First, note that `"min"` is not an allowed value for `average`. According to scikit-learn [documentation](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.f1_score.html), `average` can only take the values: `{"micro", "macro", "samples", "weighted", "binary"} or None, default="binary"`.

Second, you should take into account that all additional metric-specific argument should be passed in the method `compute` (and not in the method `load_metric`). You can find more information in our documentation: https://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores

So for example, if you would like to calculate the macro-averaged F1 score, you should use:
```python
import datasets

f1 = datasets.load_metric("f1", keep_in_memory=True)
f1.add_batch(predictions=[0,2,3], references=[1, 2, 3])
f1.compute(average="macro")
```
Issue: Metric kwargs are not passed to underlying external metric f1_score

Comment:
Thanks, that was it. A bit strange though, since `load_metric` had an argument `metric_init_kwargs`. I assume that that's for specific initialisation arguments whereas `average` is for the function itself.
Issue: [`to_json`] add multi-proc sharding support

Comment:
Hi @stas00, 
I want to work on this issue and I was thinking why don't we use `imap` [in this loop](https://github.com/huggingface/datasets/blob/440b14d0dd428ae1b25881aa72ba7bbb8ad9ff84/src/datasets/io/json.py#L99)? This way, using offset (which is being used to slice the pyarrow table) we can convert  pyarrow table to `json` using multiprocessing. I've a small code snippet for some clarity:
```
result = list(
            pool.imap(self._apply_df, [(offset, batch_size) for offset in range(0, len(self.dataset), batch_size)])
        )
```
`_apply_df` is a function which will return `batch.to_pandas().to_json(path_or_buf=None, orient="records", lines=True)` which is basically json version of the batched pyarrow table. Later on we can concatenate it to form json file? 

I think the only downside here is to write file from `imap` output (output would be a list and we'll need to iterate over it and write in a file) which might add a little overhead cost. What do you think about this?
Issue: Allow the selection of multiple columns at once

Comment:
Hi! I was looking into this and hope you can clarify a point. Your my_dataset variable would be of type DatasetDict which means the alternative you've described (dict comprehension) is what makes sense. 
Is there a reason why you wouldn't want to convert my_dataset to a pandas df if you'd like to use it like one? Please let me know if I'm missing something.
Issue: Allow the selection of multiple columns at once

Comment:
Hi! Sorry for the delay.

In this case, the dataset would be a `datasets.Dataset` and we want to select multiple columns, the `idx` and `label` columns for example.

My issue is that my dataset is too big for memory if I load everything into pandas.
Issue: Give a user feedback if the dataset he loads is streamable or not

Comment:
I understand it already raises a `NotImplementedError` exception, eg:

```
>>> dataset = load_dataset("journalists_questions", name="plain_text", split="train", streaming=True)

[...]
NotImplementedError: Extraction protocol for file at https://drive.google.com/uc?export=download&id=1CBrh-9OrSpKmPQBxTK_ji6mq6WTN_U9U is not implemented yet
```
Issue: Add SD task for SUPERB

Comment:
Note that this subset requires us to:

* generate the LibriMix corpus from LibriSpeech
* prepare the corpus for diarization

As suggested by @lhoestq we should perform these steps locally and add the prepared data to this public repo on the Hub: https://huggingface.co/datasets/superb/superb-data

Then we can use the URLs for the files to load the data in `superb`'s dataset loading script.

For consistency, I suggest we name the folders in `superb-data` in the same way as the configs in the dataset loading script - e.g. use `sd` for speech diarization in both places :)
Issue: Add SD task for SUPERB

Comment:
@lewtun @lhoestq: 

I have already generated the LibriMix corpus and prepared the corpus for diarization. The output is 3 dirs (train, dev, test), each one containing 6 files: reco2dur  rttm  segments  spk2utt  utt2spk  wav.scp

Next steps:
- Upload these files to the superb-data repo
- Transcribe the corresponding s3prl processing of these files into our superb loading script

Note that processing of these files is a bit more intricate than usual datasets: https://github.com/s3prl/s3prl/blob/master/s3prl/downstream/diarization/dataset.py#L233
Issue: Setting log level higher than warning does not suppress progress bar

Comment:
Hi,

you can suppress progress bars by patching logging as follows:
```python
import datasets
import logging
datasets.logging.get_verbosity = lambda: logging.NOTSET
# map call ...
```
EDIT: now you have to use `disable_progress_bar `
Issue: Setting log level higher than warning does not suppress progress bar

Comment:
Note also that you can disable the progress bar with

```python
from datasets.utils import disable_progress_bar
disable_progress_bar()
```

See https://github.com/huggingface/datasets/blob/8814b393984c1c2e1800ba370de2a9f7c8644908/src/datasets/utils/tqdm_utils.py#L84
Issue: Setting log level higher than warning does not suppress progress bar

Comment:
Now ``disable_progress_bar`` function is in ``datasets/src/datasets/utils/logging.py``.
https://github.com/huggingface/datasets/blob/aa555a299ad73c65e3f997a764e9d211675ab05d/src/datasets/utils/logging.py#L233-L236
And the method mentioned in https://github.com/huggingface/datasets/issues/2651#issuecomment-880270774 is not working now.
Issue: [load_dataset] shard and parallelize the process

Comment:
I think @TevenLeScao is exploring adding multiprocessing in `GeneratorBasedBuilder._prepare_split` - feel free to post updates here :)
Issue: [load_dataset] shard and parallelize the process

Comment:
Posted a PR to address the building side, still needs something to load sharded arrow files + tests
Issue: adding progress bar / ETA for `load_dataset`

Comment:
There are progress bars when downloading data and when preparing them as Arrow files.

The "total silence" part mentioned in OP refer to checksums verifications which have had some changes in the latest release 2.10:
- they're disabled by default (other less costly verifications are still done like checking the generated dataset size)
- they're using a tqdm bar as well
Issue: downloading of yahoo_answers_topics dataset failed

Comment:
Hi ! I just tested and it worked fine today for me.

I think this is because the dataset is stored on Google Drive which has a quota limit for the number of downloads per day, see this similar issue https://github.com/huggingface/datasets/issues/996 

Feel free to try again today, now that the quota was reset
Issue: load_dataset processing failed with OS error after downloading a dataset

Comment:
Hi ! It looks like an issue with pytorch.

Could you try to run `import torch` and see if it raises an error ?
Issue: load_dataset processing failed with OS error after downloading a dataset

Comment:
> Hi ! It looks like an issue with pytorch.
> 
> Could you try to run `import torch` and see if it raises an error ?

It works. Thank you!
Issue: Batched `map` not allowed to return 0 items

Comment:
Hi ! Thanks for reporting. Indeed it looks like type inference makes it fail. We should probably just ignore this step until a non-empty batch is passed.
Issue: Batched `map` not allowed to return 0 items

Comment:
Sounds good! Do you want me to propose a PR? I'm quite busy right now, but if it's not too urgent I could take a look next week.
Issue: Batched `map` not allowed to return 0 items

Comment:
Sure if you're interested feel free to open a PR :)

You can also ping me anytime if you have questions or if I can help !
Issue: Batched `map` not allowed to return 0 items

Comment:
Sorry to ping you, @lhoestq, did you have a chance to take a look at the proposed PR? Thank you!
Issue: Batched `map` not allowed to return 0 items

Comment:
Yes and it's all good, thank you :)

Feel free to close this issue if it's good for you
Issue: Enum used in map functions will raise a RecursionError with dill.

Comment:
I'm running into this as well. (Thank you so much for reporting @jorgeecardona — was staring at this massive stack trace and unsure what exactly was wrong!)
Issue: Enum used in map functions will raise a RecursionError with dill.

Comment:
Hi ! Thanks for reporting :)

Until this is fixed on `dill`'s side, we could implement a custom saving in our Pickler indefined in utils.py_utils.py
There is already a suggestion in this message about how to do it:
https://github.com/uqfoundation/dill/issues/250#issuecomment-852566284

Let me know if such a workaround could help, and feel free to open a PR if you want to contribute !