File size: 1,404 Bytes
3245442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
license: cc-by-4.0
task_categories:
- automatic-speech-recognition
language:
- en
size_categories:
- 100K<n<1M
---





# How to Use

- Almost the same with [Librispeech](https://huggingface.co/datasets/openslr/librispeech_asr) dataset module since i refered to the [source code](https://huggingface.co/datasets/openslr/librispeech_asr/blob/main/librispeech_asr.py).


```python
from datasets import load_dataset
from pprint import pprint
from IPython.display import display, Audio
import aiohttp
import os

# set huggingface cache directory for the extracted raw files and huggingface-cli token
os.environ['HF_HOME'] = "/data/to/download"  
!export HF_HOME="/data/to/download"


# download dataset
# if already have librispeech_asr in the cache_dir it will use the same audio files.
libripc = load_dataset("yoom618/librispeech_pc", 
                       "all", # all, clean, other
                       cache_dir="/data/to/download",
                       trust_remote_code=True,
                       # storage_options={'client_kwargs': {'timeout': aiohttp.ClientTimeout(total=7200)}},  # add if you need to increase the timeout


# check dataset info
print(libripc)

display(Audio(libripc['train.clean.100'][0]['audio']['array'], 
                rate=libripc['train.clean.100'][0]['audio']['sample_rate']), 
                autoplay=False)
pprint(libripc['train.clean.100'][0]['audio'])

```