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

Uploaded Python 3

File details

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

File metadata

  • Download URL: atdataset-0.2.3.tar.gz
  • Upload date:
  • Size: 42.6 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.3.tar.gz
Algorithm Hash digest
SHA256 0b775b96d056a9eb65218394c8df62686b3e5bd882cf649ba25c0728b53bc725
MD5 c0c6801b5f54e08426c656a583ae3126
BLAKE2b-256 e431fca2c1d132c3f8ab76ec3fb0df902d390c5539afaa27ed7860b0bb25dfb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atdataset-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6511328896d7224ccfea984430e85dc041491c36e95fd7f91ed11b411fd240cf
MD5 24c4a644a3cd8f0345fdf7e0f56c7eca
BLAKE2b-256 658d448fd190c87a1e857930e9f510d9c67fa32defa6dd788b2f870ae8da4550

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