语音评测工具集:ASR/TTS/SVS 常用评估指标
Project description
Speech-Eval
语音评测工具集,汇总了 ASR(自动语音识别)、TTS(语音合成)、SVS(歌声合成)等语音任务中常用的评估指标计算代码。
安装
pip install speech-eval
# 含 SpeechBERTScore / SpeechBLEU 支持(需要 PyTorch)
pip install speech-eval[bert]
支持的指标
| 指标 | 模块 | 说明 | 方向 |
|---|---|---|---|
| WER | asr | 词错误率 | 越低越好 |
| CER | asr | 字错误率 | 越低越好 |
| MCD | tts | 梅尔倒谱距离 | 越低越好 |
| Log-F0 RMSE | tts | 对数基频误差 | 越低越好 |
| SpeechBERTScore | tts | 语音语义相似度 | 越高越好 |
| SpeechBLEU | tts | 语音离散token BLEU分数 | 越高越好 |
| VUV Error | common | 清浊音分类错误率 | 越低越好 |
| Semitone ACC | svs | 半音准确率 | 越高越好 |
快速开始
# ASR
from speech_eval.asr import compute_wer, compute_cer
wer = compute_wer("the cat sat on the mat", "the cat sit on a mat")
cer = compute_cer("今天天气很好", "今天气很好")
# TTS
from speech_eval.tts import compute_mcd_pair, compute_f0_rmse_pair
mcd = compute_mcd_pair("gen.wav", "gt.wav")
f0_rmse = compute_f0_rmse_pair("gen.wav", "gt.wav")
# SVS
from speech_eval.svs import compute_semitone_acc_pair
result = compute_semitone_acc_pair("gen_singing.wav", "gt_singing.wav")
# VUV Error (TTS/SVS 通用)
from speech_eval.common import compute_vuv_error_pair
result = compute_vuv_error_pair("gen.wav", "gt.wav")
项目结构
speech-eval/
├── pyproject.toml
├── README.md
├── LICENSE
├── speech_eval/
│ ├── __init__.py
│ ├── asr/ # WER, CER
│ ├── tts/ # MCD, F0 RMSE, SpeechBERTScore, SpeechBLEU
│ ├── svs/ # Semitone ACC
│ └── common/ # VUV Error (TTS/SVS 共享)
├── examples/ # 使用示例
└── docs/ # 各模块详细文档
文档
各模块的详细用法、API 文档和指标原理请参阅:
- docs/asr.md — WER、CER 详细文档
- docs/tts.md — MCD、F0 RMSE、SpeechBERTScore、SpeechBLEU、VUV Error 详细文档
- docs/svs.md — Semitone ACC、VUV Error 详细文档
运行示例
pip install speech-eval
python examples/wer_demo.py
python examples/cer_demo.py
python examples/mcd_demo.py
python examples/f0_demo.py
python examples/semitone_demo.py
python examples/speech_bert_score_demo.py
python examples/vuv_demo.py
参考来源
- ESPnet — 语音处理工具包
- jiwer — WER/CER 计算
- pysptk — 梅尔倒谱提取
- pyworld — F0 提取
- fastdtw — 动态时间规整
- discrete-speech-metrics — SpeechBERTScore & SpeechBLEU
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file speech_eval-0.1.0.tar.gz.
File metadata
- Download URL: speech_eval-0.1.0.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc6af1ff45e63c5f302fbaf100a936d7b33555e58bc48c7f240823c2139b811
|
|
| MD5 |
ae2c5b955237ccd6221c36c076478c9c
|
|
| BLAKE2b-256 |
344915a32d97ee0913305d908a8338a831af638e74aadae52801a1246a51ed4c
|
Provenance
The following attestation bundles were made for speech_eval-0.1.0.tar.gz:
Publisher:
publish.yml on mahailiang5618/speech-eval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
speech_eval-0.1.0.tar.gz -
Subject digest:
4bc6af1ff45e63c5f302fbaf100a936d7b33555e58bc48c7f240823c2139b811 - Sigstore transparency entry: 1653095094
- Sigstore integration time:
-
Permalink:
mahailiang5618/speech-eval@4087aa483bd3766f0e925bdf3cd91a40c2e92ca0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mahailiang5618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4087aa483bd3766f0e925bdf3cd91a40c2e92ca0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file speech_eval-0.1.0-py3-none-any.whl.
File metadata
- Download URL: speech_eval-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
864aef07f0634eb1373cc8a9223c3d85ff4bdc3f35b191564a6e0b8dc5d8a5f3
|
|
| MD5 |
6207e5f80f50e5ab952ed87f73e58f0f
|
|
| BLAKE2b-256 |
1ca151951a0b05b333d967c8ddfa3541a3000c26645f65cf2208fcce652707e0
|
Provenance
The following attestation bundles were made for speech_eval-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mahailiang5618/speech-eval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
speech_eval-0.1.0-py3-none-any.whl -
Subject digest:
864aef07f0634eb1373cc8a9223c3d85ff4bdc3f35b191564a6e0b8dc5d8a5f3 - Sigstore transparency entry: 1653095293
- Sigstore integration time:
-
Permalink:
mahailiang5618/speech-eval@4087aa483bd3766f0e925bdf3cd91a40c2e92ca0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mahailiang5618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4087aa483bd3766f0e925bdf3cd91a40c2e92ca0 -
Trigger Event:
push
-
Statement type: