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.4.tar.gz (43.0 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.4-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atdataset-0.2.4.tar.gz
  • Upload date:
  • Size: 43.0 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.4.tar.gz
Algorithm Hash digest
SHA256 3eeefea2ef3ff5f59c05c3f37e02888b5acf367ae8c45878ce8dc6e072c41a90
MD5 f4885115a962457fc2d72c04cfc3497a
BLAKE2b-256 4239deb3323928c2d0e2b04659fbb5d5a0ed97ab1506bdfa88751cb6ec30d02e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atdataset-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 42.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9eb69ec734102151a79608358dfb73e5c60d80ad3c959475286051d4e818a97c
MD5 0f45ce47a9a9ab8ad39fa8e5ceb00a5f
BLAKE2b-256 2ce0cef778ee56cecccc1ba780b9bab1ee6a2b629e50446a0aa26011eaaba5f9

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