Skip to main content

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

参考来源

License

MIT

Metadata

Release files for speech-eval 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speech-eval 0.1.0
File Size Uploaded
speech_eval-0.1.0.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for speech-eval 0.1.0
File Interpreter ABI Platform
speech_eval-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.7 kB

Release files / speech_eval-0.1.0.tar.gz

Download URL speech_eval-0.1.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4bc6af1ff45e63c5f302fbaf100a936d7b33555e58bc48c7f240823c2139b811
BLAKE2b-256 checksum
How to use checksums
344915a32d97ee0913305d908a8338a831af638e74aadae52801a1246a51ed4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Release files / speech_eval-0.1.0-py3-none-any.whl

Download URL speech_eval-0.1.0-py3-none-any.whl
Size 27.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
864aef07f0634eb1373cc8a9223c3d85ff4bdc3f35b191564a6e0b8dc5d8a5f3
BLAKE2b-256 checksum
How to use checksums
1ca151951a0b05b333d967c8ddfa3541a3000c26645f65cf2208fcce652707e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page