D4nt3 commited on
Commit
7b328c5
·
verified ·
1 Parent(s): fdb2cbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -27
README.md CHANGED
@@ -1,27 +1,16 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: audio
5
- dtype:
6
- audio:
7
- sampling_rate: 16000
8
- - name: dataset
9
- dtype: string
10
- - name: text
11
- dtype: string
12
- - name: id
13
- dtype: string
14
- - name: duration_ms
15
- dtype: float64
16
- splits:
17
- - name: validation
18
- num_bytes: 109125775.62304688
19
- num_examples: 511
20
- download_size: 107921497
21
- dataset_size: 109125775.62304688
22
- configs:
23
- - config_name: default
24
- data_files:
25
- - split: validation
26
- path: data/validation-*
27
- ---
 
1
+ A filtered (<=30s duration) slice (512 samples) of the Earnings22 dataset.
2
+
3
+ ```python
4
+ def add_duration(sample):
5
+ y, sr = sample['audio']["array"], sample['audio']["sampling_rate"]
6
+ sample['duration_ms']=librosa.get_duration(y=y, sr=sr) * 1000
7
+ return sample
8
+
9
+ tedlium = load_dataset("esb/datasets", "earnings22", split='validation', trust_remote_code=True)
10
+ # compute duration to filter
11
+ tedlium = tedlium.map(add_duration)
12
+ tedlium = tedlium.select(range(512))
13
+
14
+ # Whisper max supported duration
15
+ tedlium = tedlium.filter(lambda example: example['duration_ms'] < 30000)
16
+ ```