JinchuanTian's picture
Add files using upload-large-folder tool
ea40b7c verified
|
Raw History Blame Contribute Delete
6.83 kB
---
pretty_name: Bagpiper Pretraining Data Collection
language:
- en
task_categories:
- automatic-speech-recognition
- text-to-audio
tags:
- audio
- speech
- music
- sound
- multimodal
- rich-caption
- opus
- speech-language-model
size_categories:
- 100M<n<1B
viewer: false
---
# Bagpiper Pretraining Data Collection
Opus-compressed audio with rich captions and curation subset labels, in the
archive layout the ESPnet speechlm dataloader reads directly.
This is the compressed counterpart to
[espnet/Bagpiper_PreTrain_Data](https://huggingface.co/datasets/espnet/Bagpiper_PreTrain_Data).
That repository ships HuggingFace-style Parquet with embedded audio bytes, which
is convenient for `load_dataset` but is not loadable by the training code. This
repository ships the archive format the loader expects, so it can be trained on
after one preparation command.
## Contents
**25 source datasets, 392,417,320 utterances, 933,497 audio hours, 14.00 TB.**
| dataset | utterances | hours | GB | captioned |
|---|---:|---:|---:|---:|
| owsm_v4 | 71,573,818 | 309,024 | 4,535.5 | 100.0% |
| laion_audio_300m_part3 | 65,357,718 | 127,417 | 1,914.7 | 100.0% |
| laion_audio_300m_part2 | 65,357,718 | 126,350 | 1,901.4 | 100.0% |
| laion_audio_300m_part1 | 65,357,718 | 115,279 | 1,754.5 | 100.0% |
| laion_audio_300m_part4 | 65,357,715 | 98,189 | 1,528.1 | 100.0% |
| yodas_auto | 24,907,459 | 67,254 | 1,008.2 | 99.2% |
| emilia_en | 17,514,480 | 45,214 | 679.9 | 100.0% |
| yodas_manual | 5,278,839 | 14,188 | 214.4 | 97.1% |
| laion_captioned_ai_music_snippets | 3,400,994 | 8,144 | 128.5 | 100.0% |
| fma | 2,972,622 | 8,185 | 126.0 | 100.0% |
| wavcaps | 2,749,599 | 7,440 | 106.2 | 90.7% |
| audioset | 2,053,857 | 5,705 | 84.9 | 100.0% |
| laion_in_the_wild_sound_events | 474,546 | 928 | 13.8 | 100.0% |
| clotho_train | 34,918 | 87 | 1.3 | 100.0% |
| clotho_development | 3,837 | 24 | 0.3 | 100.0% |
| mmau_test_music | 3,000 | 13 | 0.2 | 100.0% |
| mmau_test_speech | 3,000 | 12 | 0.2 | 100.0% |
| clotho_aqa | 4,880 | 12 | 0.2 | 100.0% |
| mmau_test_sound | 3,000 | 10 | 0.1 | 100.0% |
| clotho_test | 1,043 | 7 | 0.1 | 100.0% |
| librispeech_test_clean | 2,620 | 5 | 0.1 | 100.0% |
| librispeech_test_other | 2,939 | 5 | 0.1 | 100.0% |
| mmau_test_mini_music | 334 | 1 | 0.0 | 100.0% |
| mmau_test_mini_speech | 333 | 1 | 0.0 | 100.0% |
| mmau_test_mini_sound | 333 | 1 | 0.0 | 100.0% |
| **total** | **392,417,320** | **933,497** | **13,998.8** | **99.8%** |
Audio is **Ogg/Opus, 16 kHz mono, about 33 kbps**. Stereo sources are
downmixed and everything is resampled to 16 kHz, which is what the model
consumes. Opus accepts only 8, 12, 16, 24 and 48 kHz, so 22.05, 32 and 44.1 kHz
sources were resampled rather than stored at their native rate.
## Layout
```
audio/<dataset>/shard-NNNNNN.bin Ogg/Opus blobs, concatenated
audio/<dataset>/shard-NNNNNN.parquet per-shard index
audio/<dataset>/metadata.parquet merged index for the dataset
subsets/<subset>/<dataset>.txt utterance ids per curation subset
subsets/counts.json subset sizes
tools/prepare_local.py post-download preparation
```
`prepare_local.py` adds the following on your machine; they are not shipped,
because they hold absolute paths:
```
rich_caption/<dataset>/dump/** zstd caption archive (arkive_text)
data_jsons/<dataset>/{caption,<subset>}.json loader manifests: all rows, and one per subset
registry.yaml ESPNET_DATASET_REGISTRY entries
```
Each row of `metadata.parquet` carries the loader columns `utt_id`, `path`,
`start_byte_offset`, `file_size_bytes`, `start_time`, `end_time`, plus
`doc_id`, `dataset`, `sample_rate`, `channels`, `length`, `format`,
`source_sample_rate`, `source_file_size_bytes`, the caption as a plain string in
`rich_caption`, and the curation labels `subsets`, `category`, `direction`.
Utterances that are time windows over a longer recording share one Opus blob and
are distinguished by `start_time` and `end_time`, exactly as in the FLAC source.
## Curation subsets
`subsets` is a list, because an utterance can belong to none, one or two of
them. Membership comes from the stage-5 curation outputs. An utterance is only
ever in the `und` and/or `gen` set of a single modality, so `category` and
`direction` are a lossless flattening of the six base subsets. Nine further
score-ranked subsets from the SFT selection are included where they exist.
| subset | utterances | datasets |
|---|---:|---:|
| speech_und | 85,023,000 | 15 |
| speech_gen | 105,595,360 | 15 |
| sound_und | 23,980,555 | 15 |
| sound_gen | 24,001,618 | 15 |
| music_und | 14,392,994 | 15 |
| music_gen | 14,073,000 | 15 |
| speech_und_sft | 49,211 | 12 |
| speech_gen_sft | 199,847 | 11 |
| speech_gen_sft2 | 1,992,076 | 13 |
| sound_und_sft | 46,976 | 15 |
| sound_gen_sft | 169,467 | 12 |
| sound_gen_sft2 | 1,840,892 | 15 |
| music_und_sft | 28,941 | 13 |
| music_gen_sft | 61,367 | 9 |
| music_gen_sft2 | 957,323 | 15 |
## Use
```bash
huggingface-cli download --repo-type dataset espnet/Bagpiper_PreTrain_Data_Collection --local-dir ./bagpiper
python ./bagpiper/tools/prepare_local.py --root ./bagpiper
export ESPNET_DATASET_REGISTRY=./bagpiper/registry.yaml
```
The preparation step is required, and is not optional packaging. The archive
stores absolute byte offsets and the loader uses the `path` column verbatim with
no root override, so the metadata has to be pointed at wherever the files
landed. The same command also builds the zstd caption archive the
`arkive_text` reader expects, and writes one manifest per subset. It is
idempotent.
Reading a clip without ESPnet needs only a seek and a decode:
```python
import io, soundfile as sf, pyarrow.parquet as pq
# after prepare_local.py, so that `path` points at your copy
row = pq.read_table("audio/clotho_test/metadata.parquet").slice(0, 1).to_pylist()[0]
with open(row["path"], "rb") as f:
f.seek(row["start_byte_offset"])
wav, sr = sf.read(io.BytesIO(f.read(row["file_size_bytes"])))
```
This needs a libsndfile with Opus support, which means 1.0.29 or newer; 1.2.x
reports the stored 16 kHz rate correctly.
## Caveats
- Captions are machine generated and were not verified by a human. Rows whose
generation hit the length limit are kept and flagged in
`caption_finish_reason`.
- Caption coverage is not complete for every dataset; the table above gives the
per-dataset figure.
- Re-encoding from FLAC to Opus is lossy and not reversible.
- No blanket license is declared. The underlying corpora carry their own terms
and you are responsible for reviewing them.
## Citation
```bibtex
@inproceedings{tian2026bagpiper,
title = {Bagpiper},
author = {Tian, Jinchuan and others},
booktitle = {COLM},
year = {2026}
}
```