语言:
- 波斯语
缩略图: 无
管道标签: 自动语音识别
标签:
- whisper
- pytorch
- speechbrain
- Transformer
- hf-asr-leaderboard
许可证: apache-2.0
数据集:
- commonvoice
指标:
- 词错误率(WER)
- 字符错误率(CER)
模型索引:
- 名称: asr-whisper-medium-commonvoice-fa
结果:
- 任务:
名称: 自动语音识别
类型: automatic-speech-recognition
数据集:
名称: CommonVoice 10.0 (波斯语)
类型: mozilla-foundation/common_voice_14_0
配置: fa
拆分: test
参数:
language: fa
指标:
- 名称: 测试词错误率
类型: wer
值: '35.48'
推理: false
基于CommonVoice-14.0波斯语微调的whisper medium模型
本仓库提供了所有必要工具,用于在SpeechBrain框架下执行基于端到端whisper模型(在CommonVoice波斯语数据集上微调)的自动语音识别。为了获得更好的体验,我们建议您了解更多关于SpeechBrain的信息。
模型性能如下:
发布日期 |
测试字符错误率 |
测试词错误率 |
使用GPU |
2023年1月8日 |
11.27 |
35.48 |
1块V100 32GB |
流程描述
该ASR系统由whisper编码器-解码器模块组成:
- 预训练的whisper-medium编码器被冻结
- 使用预训练的Whisper分词器
- 预训练的Whisper-medium解码器(openai/whisper-medium)在CommonVoice波斯语数据上微调
最终获得的声学表征输入给贪心解码器。
系统训练使用16kHz采样率(单声道)的录音。当调用transcribe_file时,代码会自动对音频进行标准化处理(如重采样+单声道选择)。
安装SpeechBrain
首先,请使用以下命令安装transformers和SpeechBrain:
pip install speechbrain transformers
请注意,我们建议您阅读我们的教程以了解更多关于SpeechBrain的信息。
转录您自己的波斯语音频文件
from speechbrain.inference.ASR import WhisperASR
asr_model = WhisperASR.from_hparams(source="speechbrain/asr-whisper-medium-commonvoice-fa", savedir="pretrained_models/asr-whisper-medium-commonvoice-fa")
asr_model.transcribe_file("speechbrain/asr-whisper-medium-commonvoice-fa/example-fa.mp3")
GPU推理
要在GPU上执行推理,在调用from_hparams
方法时添加run_opts={"device":"cuda"}
参数。
训练
该模型使用SpeechBrain进行训练。要从头开始训练,请遵循以下步骤:
- 克隆SpeechBrain:
git clone https://github.com/speechbrain/speechbrain/
- 安装:
cd speechbrain
pip install -r requirements.txt
pip install -e .
- 运行训练:
cd recipes/CommonVoice/ASR/transformer/
python train_with_whisper.py hparams/train_fa_hf_whisper.yaml --data_folder=您的数据文件夹
您可以在此处找到我们的训练结果(模型、日志等)。
局限性
SpeechBrain团队不保证该模型在其他数据集上的性能表现。
引用SpeechBrain
@misc{SB2021,
author = {Ravanelli, Mirco 等人},
title = {SpeechBrain},
year = {2021},
publisher = {GitHub},
journal = {GitHub仓库},
howpublished = {\\\\url{https://github.com/speechbrain/speechbrain}},
}
关于SpeechBrain
SpeechBrain是一个开源的一体化语音工具包。其设计简单、极其灵活且用户友好。在多个领域都获得了具有竞争力或最先进的性能。
官网: https://speechbrain.github.io/
GitHub: https://github.com/speechbrain/speechbrain