语言:
- 法语
缩略图: 无
管道标签: 自动语音识别
标签:
- CTC
- pytorch
- speechbrain
- Transformer
- hf-asr-leaderboard
许可证: apache-2.0
数据集:
- commonvoice
指标:
- wer
- cer
模型索引:
- 名称: asr-wav2vec2-commonvoice-fr
结果:
- 任务:
名称: 自动语音识别
类型: automatic-speech-recognition
数据集:
名称: CommonVoice 6.1 (法语)
类型: mozilla-foundation/common_voice_6_1
配置: fr
分割: test
参数:
language: fr
指标:
- 名称: 测试 WER
类型: wer
值: '9.96'
基于CommonVoice法语训练的wav2vec 2.0与CTC/Attention模型(无语言模型)
本仓库提供了所有必要的工具,用于在SpeechBrain框架内执行基于CommonVoice(法语)预训练的端到端自动语音识别系统。为了获得更好的体验,我们鼓励您了解更多关于SpeechBrain的信息。
该模型的性能如下:
发布版本 |
测试CER |
测试WER |
使用的GPU |
24-08-21 |
3.19 |
9.96 |
2xV100 32GB |
流程描述
该ASR系统由两个不同但相互关联的模块组成:
- 分词器(unigram),将单词转换为子词单元,并使用CommonVoice(FR)的训练转录(train.tsv)进行训练。
- 声学模型(wav2vec2.0 + CTC)。一个预训练的wav2vec 2.0模型(LeBenchmark/wav2vec2-FR-7K-large)与两个DNN层结合,并在CommonVoice FR上进行微调。得到的最终声学表示被提供给CTC贪婪解码器。
系统使用16kHz采样的录音(单声道)进行训练。在调用transcribe_file时,代码会自动对音频进行归一化处理(即重采样+单声道选择),如果需要的话。
安装SpeechBrain
首先,请使用以下命令安装transformers和SpeechBrain:
pip install speechbrain transformers
请注意,我们鼓励您阅读我们的教程,了解更多关于SpeechBrain的信息。
转录您自己的音频文件(法语)
from speechbrain.inference.ASR import EncoderASR
asr_model = EncoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-fr", savedir="pretrained_models/asr-wav2vec2-commonvoice-fr")
asr_model.transcribe_file('speechbrain/asr-wav2vec2-commonvoice-fr/example-fr.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/CTC/
python train_with_wav2vec.py hparams/train_fr_with_wav2vec.yaml --data_folder=your_data_folder
您可以在此处找到我们的训练结果(模型、日志等)here。
局限性
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