Modify typesetting, test=doc

pull/1427/head
lizi 4 years ago
parent 06e8bdf0d7
commit 5e34cdbd6e

@ -55,13 +55,13 @@ PaddleSpeech的TTS模型具有以下映射关系
source path.sh
```
**在你开始做任何事情之前,必须先做这步**
`MAIN_ROOT` 设置为项目目录. 使用 `fastspeech2` 模型作为 `MODEL`.
`MAIN_ROOT` 设置为项目目录. 使用 `fastspeech2` 模型作为 `MODEL`
- 运行
```bash
bash run.sh
```
这只是一个演示,请确保源数据已经准备好,并且在下一个 `步骤` 之前每个 `步骤` 都运行正常.
这只是一个演示,请确保源数据已经准备好,并且在下一个 `步骤` 之前每个 `步骤` 都运行正常
`run.sh` 中主要包括以下步骤:
@ -101,11 +101,11 @@ checkpoint_name
- `*_stats.npy` 是特征的统计文件,如果它在训练前已被标准化。
- `phone_id_map.txt` 是音素到音素 ID 的映射关系。
- `tone_id_map.txt` 是在训练声学模型之前分割音调和拼音时,音调到音调 ID 的映射关系。(例如在 csmsc/speedyspeech 的示例中)
- `spk_id_map.txt` 是多speaker声学模型中speaker到spk_ids的映射关系。
- `spk_id_map.txt` 是多发音人声学模型中`发音人`到`spk_ids`的映射关系。
下面的示例代码显示了如何使用模型进行预测。
### Acoustic Models 声学模型(文本到频谱图)
下面的代码显示了如何使用“FastSpeech2”模型。加载预训练模型后使用它和normalizer对象构建预测对象然后使用`fastspeech2_inferencet(phone_ids)`生成频谱图,频谱图可进一步用于使用声码器合成原始音频。
下面的代码显示了如何使用 `FastSpeech2` 模型。加载预训练模型后,使用它和 normalizer 对象构建预测对象,然后使用 `fastspeech2_inferencet(phone_ids)` 生成频谱图,频谱图可进一步用于使用声码器合成原始音频。
```python
from pathlib import Path

@ -1,5 +1,4 @@
# 用 CSMSC 数据集训练 FastSpeech2 模型
This example contains code used to train a [Fastspeech2](https://arxiv.org/abs/2006.04558) model with [Chinese Standard Mandarin Speech Copus](https://www.data-baker.com/open_source.html).
本用例包含用于训练 [Fastspeech2](https://arxiv.org/abs/2006.04558) 模型的代码,使用 [Chinese Standard Mandarin Speech Copus](https://www.data-baker.com/open_source.html) 数据集。
@ -9,7 +8,7 @@ This example contains code used to train a [Fastspeech2](https://arxiv.org/abs/2
### 获取MFA结果并解压
我们使用 [MFA](https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner) 去获得 fastspeech2 的音素持续时间。
你们可以从这里下载 [baker_alignment_tone.tar.gz](https://paddlespeech.bj.bcebos.com/MFA/BZNSYP/with_tone/baker_alignment_tone.tar.gz), 或参考 [mfa example](https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/examples/other/mfa) 训练你自己的模型of our repo.
你们可以从这里下载 [baker_alignment_tone.tar.gz](https://paddlespeech.bj.bcebos.com/MFA/BZNSYP/with_tone/baker_alignment_tone.tar.gz), 或参考 [mfa example](https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/examples/other/mfa) 训练你自己的模型
## 开始
假设数据集的路径是 `~/datasets/BZNSYP`.
@ -53,7 +52,6 @@ dump
├── raw
└── speech_stats.npy
```
The dataset is split into 3 parts, namely `train`, `dev`, and` test`, each of which contains a `norm` and `raw` subfolder. The raw folder contains speech、pitch and energy features of each utterance, while the norm folder contains normalized ones. The statistics used to normalize features are computed from the training set, which is located in `dump/train/*_stats.npy`.
数据集分为三个部分,即 `train``dev``test` ,每个部分都包含一个 `norm``raw` 子文件夹。原始文件夹包含每个话语的语音、音调和能量特征,而 `norm` 文件夹包含规范化的特征。用于规范化特征的统计数据是从 `dump/train/*_stats.npy` 中的训练集计算出来的。
@ -63,7 +61,7 @@ The dataset is split into 3 parts, namely `train`, `dev`, and` test`, each of wh
```bash
CUDA_VISIBLE_DEVICES=${gpus} ./local/train.sh ${conf_path} ${train_output_path}
```
`./local/train.sh` calls `${BIN_DIR}/train.py`.
`./local/train.sh` 调用 `${BIN_DIR}/train.py`
以下是完整的帮助信息。
```text
@ -217,7 +215,7 @@ optional arguments:
2. `--am_config`, `--am_checkpoint`, `--am_stat``--phones_dict` 是声学模型的参数,对应于 fastspeech2 预训练模型中的 4 个文件。
3. `--voc` 声码器(vocoder)格式是否符合 {model_name}_{dataset}
4. `--voc_config`, `--voc_checkpoint`, `--voc_stat` 是声码器的参数,对应于 parallel wavegan 预训练模型中的 3 个文件。
5. `--lang` 对应模型的语言可以是 `zh``en`.
5. `--lang` 对应模型的语言可以是 `zh``en`
6. `--test_metadata` 应为 `dump` 文件夹中 `test` 下的规范化元数据文件、
7. `--text` 是文本文件,其中包含要合成的句子。
8. `--output_dir` 是保存合成音频文件的目录。
@ -251,7 +249,7 @@ fastspeech2_nosil_baker_ckpt_0.4
├── snapshot_iter_76000.pdz # 模型参数和优化器状态
└── speech_stats.npy # 训练 fastspeech2 时用于规范化频谱图的统计数据
```
您可以使用以下脚本通过使用预训练的fastspeech2和并行wavegan模型为 `${BIN_DIR}/../sentences.txt` 合成句子
您可以使用以下脚本通过使用预训练的 fastspeech2 和 parallel wavegan 模型为 `${BIN_DIR}/../sentences.txt` 合成句子
```bash
source path.sh

Loading…
Cancel
Save