Update README.md
Browse files
README.md
CHANGED
|
@@ -1,27 +1,16 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 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 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|