Add KS task to SUPERB
{'login': 'anton-l', 'id': 26864830, 'node_id': 'MDQ6VXNlcjI2ODY0ODMw', 'avatar_url': 'https://avatars.githubusercontent.com/u/26864830?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/anton-l', 'html_url': 'https://github.com/anton-l', 'followers_url': 'https://api.github.com/users/anton-l/followers', 'following_url': 'https://api.github.com/users/anton-l/following{/other_user}', 'gists_url': 'https://api.github.com/users/anton-l/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/anton-l/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/anton-l/subscriptions', 'organizations_url': 'https://api.github.com/users/anton-l/orgs', 'repos_url': 'https://api.github.com/users/anton-l/repos', 'events_url': 'https://api.github.com/users/anton-l/events{/privacy}', 'received_events_url': 'https://api.github.com/users/anton-l/received_events', 'type': 'User', 'site_admin': False}
[]
[]
["thanks a lot for implementing this @anton-l !!\r\n\r\ni won't have time to review this while i'm away, so happy for @albertvillanova and @patrickvonplaten to decide when to merge :)"
 '@albertvillanova thanks! Everything should be ready now :)'
 '> The _background_noise_/_silence_ audio files are much longer than others, so they require some sort of slicing for downstream training. I decided to leave the implementation of that up to the users, since TFDS and s3prl take different approaches (either slicing wavs deterministically, or subsampling randomly at runtime)\r\n\r\n@anton-l I was thinking that maybe we could give some hints in the dataset card (in a Usage section); something similar as for diarization: https://github.com/huggingface/datasets/blob/master/datasets/superb/README.md#example-of-usage\r\nNote that for diarization it is not yet finished: we have to test it and then provide an end-to-end example: https://github.com/huggingface/datasets/pull/2661/files#r680224909 '
 '@albertvillanova yeah, I\'m not sure how to best implement it in pure `datasets` yet. It\'s something like this, where `sample_noise()` needs to be called from a pytorch batch collator or other framework-specific variant:\r\n\r\n```python\r\ndef map_to_array(example):\r\n    import soundfile as sf\r\n\r\n    speech_array, sample_rate = sf.read(example["file"])\r\n    example["speech"] = speech_array\r\n    example["sample_rate"] = sample_rate\r\n    return example\r\n\r\n\r\ndef sample_noise(example):\r\n    # Use a version of this function in a stateless way to extract random 1 sec slices of background noise\r\n    # on each epoch\r\n    from random import randint\r\n\r\n    # _silence_ audios are longer than 1 sec\r\n    if example["label"] == "_silence_":\r\n        random_offset = randint(0, len(example["speech"]) - example["sample_rate"] - 1)\r\n        example["speech"] = example["speech"][random_offset : random_offset + example["sample_rate"]]\r\n\r\n    return example\r\n```'
 'I see... Yes, not trivial indeed. Maybe for the moment you could add those functions above to the README (as it is the case for now in diarization)? What do you think?']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/2783', 'html_url': 'https://github.com/huggingface/datasets/pull/2783', 'diff_url': 'https://github.com/huggingface/datasets/pull/2783.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/2783.patch', 'merged_at': datetime.datetime(2021, 8, 11, 20, 19, 17)}
Add the KS (keyword spotting) task as described in the [SUPERB paper](https://arxiv.org/abs/2105.01051).

- [s3prl instructions](https://github.com/s3prl/s3prl/blob/master/s3prl/downstream/README.md#ks-keyword-spotting)
- [s3prl implementation](https://github.com/s3prl/s3prl/blob/master/s3prl/downstream/speech_commands/dataset.py)
- [TFDS implementation](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/audio/speech_commands.py)

Some notable quirks:
- The dataset is originally single-archive (train+val+test all in one), but the test set has a "canonical" distribution in a separate archive, which is also used here (see `_split_ks_files()`). 
- The `_background_noise_`/`_silence_` audio files are much longer than others, so they require some sort of slicing for downstream training. I decided to leave the implementation of that up to the users, since TFDS and s3prl take different approaches (either slicing wavs deterministically, or subsampling randomly at runtime)

Related to #2619.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/2783/reactions', 'total_count': 3, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 3, 'rocket': 0, 'eyes': 0}