ayousanz's picture
Add dataset card with usage instructions
173f658 verified
|
Raw
History Blame
6.52 kB
---
license: cc-by-sa-4.0
language:
- ja
- en
- zh
- es
- fr
- pt
task_categories:
- text-to-speech
tags:
- tts
- vits
- multilingual
- piper
- webdataset
size_categories:
- 100K<n<1M
---
# Piper Plus Base Dataset (6-Language Multilingual)
[Piper Plus](https://github.com/ayutaz/piper-plus) TTS の事前学習用 6 言語マルチリンガルデータセットです。音素化・スペクトログラム計算済みのため、ダウンロード後すぐに学習を開始できます。
## Dataset Summary
| Item | Value |
|------|-------|
| Total utterances | 497,519 |
| Speakers | 571 |
| Languages | 6 |
| Phoneme symbols | 173 |
| Sample rate | 22,050 Hz |
| Format | WebDataset (tar shards) |
| Shards | 48 |
| Total size | ~411 GB |
### Per-Language Breakdown
| Language | Code | ID | Speakers | Utterances | Source |
|----------|------|----|----------|------------|--------|
| Japanese | ja | 0 | 20 | 59,694 | [MOE-Speech](https://huggingface.co/datasets/ayousanz/moe-speech-20speakers-ljspeech) |
| English | en | 1 | 310 | 64,698 | [LibriTTS-R](https://www.openslr.org/141/) |
| Chinese | zh | 2 | 142 | 63,223 | [AISHELL-3](https://www.openslr.org/93/) (Apache-2.0) |
| Spanish | es | 3 | 63 | 168,374 | [CML-TTS](https://www.openslr.org/146/) (CC-BY-4.0) |
| French | fr | 4 | 28 | 107,464 | [CML-TTS](https://www.openslr.org/146/) (CC-BY-4.0) |
| Portuguese | pt | 5 | 8 | 34,066 | [CML-TTS](https://www.openslr.org/146/) (CC-BY-4.0) |
## Data Format
WebDataset tar 形式。各 tar シャードには以下の 3 ファイルがサンプルごとに含まれます:
```
000000000.audio_norm.pt # 正規化音声波形 (torch.float32, shape: [1, T])
000000000.audio_spec.pt # メルスペクトログラム (torch.float16, shape: [513, M])
000000000.json # メタデータ (下記参照)
```
### Metadata Schema (JSON)
```json
{
"text": "こんにちは",
"speaker": "00163dc9",
"speaker_id": 12,
"language_id": 0,
"phonemes": ["k", "o", "N_n", ...],
"phoneme_ids": [1, 0, 32, 0, 15, ...],
"prosody_features": [null, null, {"a1": 0, "a2": 1, "a3": 3}, ...]
}
```
| Field | Type | Description |
|-------|------|-------------|
| `text` | string | 元テキスト |
| `speaker` | string | 話者名/ID |
| `speaker_id` | int | 話者インデックス (0-570) |
| `language_id` | int | 言語インデックス (0-5) |
| `phonemes` | list[str] | IPA 音素トークン列 |
| `phoneme_ids` | list[int] | モデル入力用の整数 ID 列 (BOS/EOS/padding 含む) |
| `prosody_features` | list | A1/A2/A3 韻律特徴 (日本語のみ、他言語は null) |
## Audio Specifications
| Parameter | Value |
|-----------|-------|
| Sample rate | 22,050 Hz |
| FFT size | 1,024 |
| Hop length | 256 |
| Window length | 1,024 |
| Mel channels | 513 |
| Spectrogram dtype | float16 |
| Audio dtype | float32 |
## Usage
### Download
```bash
# huggingface-cli でダウンロード
huggingface-cli download ayousanz/piper-plus-base-dataset \
--repo-type dataset \
--local-dir ./piper-plus-base-dataset
```
### Load with WebDataset
```python
import webdataset as wds
import torch
import json
dataset = (
wds.WebDataset("piper-plus-base-dataset/data/train-{00000..00047}-of-00048.tar")
.decode()
.map(lambda sample: {
"audio_norm": torch.load(sample["audio_norm.pt"], weights_only=True),
"audio_spec": torch.load(sample["audio_spec.pt"], weights_only=True),
"meta": json.loads(sample["json"]),
})
)
for sample in dataset:
print(sample["meta"]["text"], sample["audio_norm"].shape)
break
```
### Extract to Piper Training Format
tar シャードを展開し、Piper の学習形式 (`dataset.jsonl` + `cache/`) に変換するには:
```python
import io
import json
import tarfile
from pathlib import Path
output_dir = Path("./extracted_dataset")
cache_dir = output_dir / "cache" / "22050"
cache_dir.mkdir(parents=True, exist_ok=True)
entries = []
for shard in sorted(Path("./piper-plus-base-dataset/data").glob("*.tar")):
with tarfile.open(shard) as tf:
members = sorted(tf.getnames())
keys = sorted(set(m.split(".")[0] for m in members))
for key in keys:
meta = json.loads(tf.extractfile(f"{key}.json").read())
# Save .pt files to cache
for ext in ["audio_norm.pt", "audio_spec.pt"]:
data = tf.extractfile(f"{key}.{ext}").read()
(cache_dir / f"{key}.{ext.replace('audio_norm', 'norm').replace('audio_spec', 'spec')}").write_bytes(data)
meta["audio_norm_path"] = str(cache_dir / f"{key}.norm.pt")
meta["audio_spec_path"] = str(cache_dir / f"{key}.spec.pt")
entries.append(meta)
with open(output_dir / "dataset.jsonl", "w") as f:
for e in entries:
f.write(json.dumps(e, ensure_ascii=False) + "\n")
```
## Training
このデータセットで Piper Plus を学習する例:
```bash
python -m piper_train \
--dataset-dir ./extracted_dataset \
--prosody-dim 16 \
--accelerator gpu --devices 4 --precision 32-true \
--max_epochs 75 --batch-size 20 --samples-per-speaker 2 \
--checkpoint-epochs 5 --quality medium \
--base_lr 2e-4 --disable_auto_lr_scaling \
--ema-decay 0.9995 \
--max-phoneme-ids 400 \
--no-wavlm \
--audio-log-epochs 5
```
## Pre-trained Models
| Model | Description | Link |
|-------|-------------|------|
| Base (6-lang, 75 epoch) | 571 speakers, HiFi-GAN decoder | [ayousanz/piper-plus-base](https://huggingface.co/ayousanz/piper-plus-base) |
| Tsukuyomi-chan | Single speaker finetuned from base | [ayousanz/piper-plus-tsukuyomi-chan](https://huggingface.co/ayousanz/piper-plus-tsukuyomi-chan) |
## Preprocessing Pipeline
このデータセットは以下のパイプラインで作成されました:
1. **prepare_multilingual_dataset.py** -- 6 言語ソースデータの統合・音素化・音声キャッシュ生成
2. **Speaker filtering** -- 30 発話未満の話者を除外 (657 -> 571 speakers)
3. **Speaker ID remapping** -- 連続 ID (0-570) にリマッピング
## License
- Dataset: CC-BY-SA-4.0
- Source corpora:
- MOE-Speech: CC-BY-SA-4.0
- LibriTTS-R: CC-BY-4.0
- AISHELL-3: Apache-2.0
- CML-TTS (ES/FR/PT): CC-BY-4.0
## Citation
```bibtex
@misc{piper-plus-base-dataset,
title={Piper Plus Base Dataset: 6-Language Multilingual TTS Training Data},
author={ayousanz},
year={2026},
url={https://huggingface.co/datasets/ayousanz/piper-plus-base-dataset}
}
```