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.2.tar.gz (42.5 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.2-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atdataset-0.2.2.tar.gz
  • Upload date:
  • Size: 42.5 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.2.tar.gz
Algorithm Hash digest
SHA256 c6cc994f4cf1ad5f09826ffcf8732564d435d8d4b9cfeb03d7599ed7d2364fe1
MD5 a9fd52e5c84b7dbf23918e768616d4ab
BLAKE2b-256 343fa893fa82398726f3a58e8094405e5715dfc253dda10361a66bc04078dd8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atdataset-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 41.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd95577b2ba7e934d566ae54c662ff7b51862a9029f20c007df5ec1da75fe86f
MD5 172a7e1b7371cb5ddfa844faf499bd71
BLAKE2b-256 5deaf997504623a17462491a5a592286db19b05f4d9b2fb0ca4f81df521179b0

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