Skip to main content

Audio text dataset for PyTorch training based on webdataset.

Project description

ATdataset

A streaming audio-text dataloader for PyTorch training, built on WebDataset.

Designed for large-scale speech recognition training with multi-dataset muxing, dynamic batching, bucketing, and on-the-fly augmentation.

Install

pip install atdataset

For development:

git clone https://github.com/pkufool/ATdataset.git
cd ATdataset
pip install -e ".[dev]"

Quick Start

from atdataset import ATDataloader

dl = ATDataloader(
    datasets="data/tars/train.lst",
    sample_rate=16000,
    max_duration=600.0,
)

for batch in dl:
    audio = batch["audio"]          # (B, T), padded
    audio_lens = batch["audio_lens"]  # (B,)
    feature = batch["feature"]      # (B, T, F), padded
    feature_lens = batch["feature_lens"]  # (B,)
    texts = batch["text"]           # list of str
    break

CLI Tools

After installation, the atdataset command provides two subcommands:

# Build tar shards from a TSV manifest
atdataset build --input train.tsv --output-dir data/tars --num-tars 64

# Generate a .lst file from existing tar shards
atdataset gen_lst --audio-pattern 'data/tars/audios/*.tar' \
    --txt-dir data/tars/manifests --output data/tars/train.lst

Run atdataset build --help or atdataset gen_lst --help for full option details.

Documentation

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atdataset-0.2.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atdataset-0.2.0-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file atdataset-0.2.0.tar.gz.

File metadata

  • Download URL: atdataset-0.2.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.20

File hashes

Hashes for atdataset-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab6ff882b480b9a50fe87bf101c76f6e0bda9d7df135d774a193880e333abd26
MD5 4ccb1f61cd7973916820348ad9304375
BLAKE2b-256 97886bc06bcd74cc69a2db3cbe9be59558dad7c4d1c548837934ae9eea880610

See more details on using hashes here.

File details

Details for the file atdataset-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: atdataset-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.20

File hashes

Hashes for atdataset-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56269e167bd95d739dccf7c3917fd69b3e28b91789a0dc095d4f47d2f5e0f2da
MD5 5b34c9c5ca77e77915c2a7b9d5b35472
BLAKE2b-256 1d16adf3be466b80e0f1ae8dce00a10b41ac1a63a12b611e25e09b9e9c447c89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page