Muraddshi's picture
Create Readme.md
a583dd2 verified

Cloudflare Speech Dataset (R2) — Load-time Augmentations

Downloads zipped speech data from Cloudflare R2 and yields audio samples via HuggingFace datasets.
Augmentations are applied on-the-fly at load time (not pre-saved).

Requirements

  • datasets
  • s3fs
  • librosa
  • pydub
  • audiomentations
  • ffmpeg (recommended)

R2 Credentials

export R2_ACCOUNT_ID="..."
export R2_ACCESS_KEY_ID="..."
export R2_SECRET_ACCESS_KEY="..."

Basic Usage

from datasets import load_dataset

ds = load_dataset(
    "aai-labs/cloudflare-speech-dataset-augmented",
    name="liepa2",
    trust_remote_code=True,
)

Enable Augmentations

Parameters:

  • aug_enable=True
  • apply_augmentations: train | validation | test | none
  • noise, reverb, channel, bitcrush: probabilities ("25", "25%", or 0.25)
    • Probabilities must sum ≤ 1.0
    • Max one augmentation per sample
    • Deterministic per-sample via aug_seed
ds = load_dataset(
    "aai-labs/cloudflare-speech-dataset-augmented",
    name="liepa2",
    trust_remote_code=True,
    aug_enable=True,
    apply_augmentations="train",
    noise="25",
    reverb="25",
    channel="25",
    bitcrush="25",
    aug_seed=42,
)

Intensity Controls

Noise (SNR, lower = stronger):

  • min_snr_db=18, max_snr_db=30

Channel (band-limiting):

  • hp_min_cutoff=150, hp_max_cutoff=400
  • lp_min_cutoff=2000, lp_max_cutoff=3200

Bitcrush:

  • min_bit_depth=6, max_bit_depth=10

Augmentation Assets

Defaults (downloaded & cached on first use):

  • noise_prefix="asr-training-data/augmentation/noise"
  • ir_prefix="asr-training-data/augmentation/ir"

Notes

  • Keep validation/test clean (apply_augmentations="train")
  • Saving is optional; on-the-fly is fine
  • To precompute:
    ds["train"].save_to_disk("/path/train_aug_v1")