语言:
- 波斯语
缩略图: 无
管道标签: 自动语音识别
标签:
- whisper
- pytorch
- speechbrain
- Transformer
- hf-asr-leaderboard
许可证: apache-2.0
数据集:
- commonvoice
指标:
- 词错误率(WER)
- 字符错误率(CER)
模型索引:
- 名称: asr-whisper-large-v2-commonvoice-ar
结果:
- 任务:
名称: 自动语音识别
类型: automatic-speech-recognition
数据集:
名称: CommonVoice 10.0 (波斯语)
类型: mozilla-foundation/common_voice_10_0
配置: fa
拆分: test
参数:
language: fa
指标:
- 名称: 测试词错误率
类型: wer
值: '31.75'
推理: false
基于CommonVoice波斯语数据微调的whisper large-v2模型
本仓库提供了所有必要工具,用于在SpeechBrain框架内执行基于端到端whisper模型(在CommonVoice波斯语数据集上微调)的自动语音识别。为了获得更好的体验,我们建议您了解更多关于SpeechBrain的信息。
该模型的性能如下:
发布日期 |
测试字符错误率(CER) |
测试词错误率(WER) |
使用的GPU |
2023-01-02 |
9.38 |
31.75 |
1块V100 16GB |
流程描述
该ASR系统由whisper编码器-解码器模块组成:
- 预训练的whisper-large-v2编码器被冻结使用
- 使用预训练的Whisper分词器
- 基于CommonVoice波斯语数据微调预训练的Whisper-large-v2解码器(openai/whisper-large-v2)
最终获得的声学表征会输入给贪心解码器。
系统训练使用的录音采样率为16kHz(单声道)。当调用transcribe_file时,代码会自动对音频进行标准化处理(如需要,会进行重采样和单声道选择)。
安装SpeechBrain
首先,请使用以下命令安装transformers和SpeechBrain:
pip install speechbrain transformers==4.28.0
请注意,我们建议您阅读我们的教程并了解更多关于SpeechBrain的信息。
转录您自己的波斯语音频文件
from speechbrain.inference.ASR import WhisperASR
asr_model = WhisperASR.from_hparams(source="speechbrain/asr-whisper-large-v2-commonvoice-fa", savedir="pretrained_models/asr-whisper-large-v2-commonvoice-fa")
asr_model.transcribe_file("speechbrain/asr-whisper-large-v2-commonvoice-fa/example-fa.wav")
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 and Parcollet, Titouan and Rouhe, Aku and Plantinga, Peter and Rastorgueva, Elena and Lugosch, Loren and Dawalatabad, Nauman and Ju-Chieh, Chou and Heba, Abdel and Grondin, Francois and Aris, William and Liao, Chien-Feng and Cornell, Samuele and Yeh, Sung-Lin and Na, Hwidong and Gao, Yan and Fu, Szu-Wei and Subakan, Cem and De Mori, Renato and Bengio, Yoshua },
title = {SpeechBrain},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\\\\url{https://github.com/speechbrain/speechbrain}},
}
关于SpeechBrain
SpeechBrain是一个开源的一体化语音工具包。它设计简单、极其灵活且用户友好。在多个领域都能获得具有竞争力或最先进的性能。
官网: https://speechbrain.github.io/
GitHub仓库: https://github.com/speechbrain/speechbrain