Skip to main content

Automatic speech recognition toolkit on Pytorch

Project description

python version GitHub forks GitHub Repo stars GitHub 支持系统

MASR流式与非流式语音识别项目

MASR是一款基于Pytorch实现的自动语音识别框架,MASR全称是神奇的自动语音识别框架(Magical Automatic Speech Recognition),当前为V3版本,与V2版本不兼容,如果想使用V2版本,请在这个分支V2。MASR致力于简单,实用的语音识别项目。可部署在服务器,Nvidia Jetson设备,未来还计划支持Android等移动设备。

欢迎大家扫码入知识星球或者QQ群讨论,知识星球里面提供项目的模型文件和博主其他相关项目的模型文件,也包括其他一些资源。

知识星球 QQ群

本项目使用的环境:

  • Anaconda 3
  • Python 3.11
  • Pytorch 2.5.1
  • Windows 11 or Ubuntu 22.04

在线试用

网页版:在线试用地址

微信小程序
微信小程序

项目特点

  1. 支持多个语音识别模型,包含deepspeech2conformersqueezeformerefficient_conformer等,每个模型都支持流式识别和非流式识别,在配置文件中streaming参数设置。
  2. 支持多种解码器,包含ctc_greedy_searchctc_prefix_beam_searchattention_rescoringctc_beam_search等。
  3. 支持多种预处理方法,包含fbankmfcc等。
  4. 支持多种数据增强方法,包含噪声增强、混响增强、语速增强、音量增强、重采样增强、位移增强、SpecAugmentor、SpecSubAugmentor等。
  5. 支持多种推理方法,包含短音频推理、长音频推理、流式推理、说话人分离推理等。
  6. 更多特点等待你发现。

与V2版本的区别

  1. 项目结构的优化,大幅度降低的使用难度。
  2. 更换预处理的库,改用kaldi_native_fbank,在提高数据预处理的速度,同时也支持多平台。
  3. 修改token的方法,使用sentencepiece制作token,这个框架极大的降低了多种语言的处理难度,同时还使中英文混合训练成为可能。

更新记录

  • 2025.3: 正式发布最终级的V3版本。

模型下载

  1. WenetSpeech (10000小时,普通话) 的预训练模型列表,错误率类型为字错率(CER):
使用模型 是否为流式 预处理方式 解码方式 test_net test_meeting aishell_test 下载地址
Conformer True fbank ctc_greedy_search 0.14391 0.18665 0.06751 加入知识星球获取
Conformer True fbank ctc_prefix_beam_search 0.14326 0.18488 0.06763 加入知识星球获取
Conformer True fbank attention_rescoring 0.13523 0.18069 0.06079 加入知识星球获取
Conformer True fbank ctc_beam_search 0.18227 0.21586 0.04981 加入知识星球获取
DeepSpeech2 True fbank ctc_greedy_search 加入知识星球获取
DeepSpeech2 True fbank ctc_prefix_beam_search 加入知识星球获取
DeepSpeech2 True fbank ctc_beam_search 加入知识星球获取
  1. AIShell (179小时,普通话) 的预训练模型列表,错误率类型为字错率(CER):
使用模型 是否为流式 预处理方式 解码方式 自带的测试集 下载地址
Conformer True fbank ctc_greedy_search 0.06134 加入知识星球获取
Conformer True fbank ctc_prefix_beam_search 0.06132 加入知识星球获取
Conformer True fbank attention_rescoring 0.05366 加入知识星球获取
Conformer True fbank ctc_beam_search 0.04409 加入知识星球获取
DeepSpeech2 True fbank ctc_greedy_search 0.12000 加入知识星球获取
DeepSpeech2 True fbank ctc_prefix_beam_search 0.12016 加入知识星球获取
DeepSpeech2 True fbank ctc_beam_search 0.08748 加入知识星球获取
  1. Librispeech (960小时,英语) 的预训练模型列表,错误率类型为词错率(WER):
使用模型 是否为流式 预处理方式 解码方式 自带的测试集 下载地址
Conformer True fbank ctc_greedy_search 0.07432 加入知识星球获取
Conformer True fbank ctc_prefix_beam_search 0.07418 加入知识星球获取
Conformer True fbank attention_rescoring 0.06549 加入知识星球获取
Conformer True fbank ctc_beam_search / 加入知识星球获取
DeepSpeech2 True fbank ctc_greedy_search 0.15491 加入知识星球获取
DeepSpeech2 True fbank ctc_prefix_beam_search 0.15307 加入知识星球获取
DeepSpeech2 True fbank ctc_beam_search / 加入知识星球获取
  1. 其他数据集的预训练模型列表,错误率类型,如果是中文就是字错率(CER),英文则是词错率(WER),中英混合为混合错误率(MER):
使用模型 是否为流式 预处理方式 数据集 语言 解码方式 测试数据 下载地址
Conformer True fbank 粤语数据集 粤语 ctc_greedy_search 0.05596 加入知识星球获取
Conformer True fbank 粤语数据集 粤语 ctc_prefix_beam_search 0.05595 加入知识星球获取
Conformer True fbank 粤语数据集 粤语 attention_rescoring 0.04846 加入知识星球获取
Conformer True fbank 粤语数据集 粤语 ctc_beam_search 0.05280 加入知识星球获取
Conformer True fbank 中英混合数据集 中英文 ctc_greedy_search 0.09582 加入知识星球获取
Conformer True fbank 中英混合数据集 中英文 ctc_prefix_beam_search 0.09523 加入知识星球获取
Conformer True fbank 中英混合数据集 中英文 attention_rescoring 0.08470 加入知识星球获取
Conformer True fbank 中英混合数据集 中英文 ctc_beam_search / 加入知识星球获取
Conformer True fbank 更大数据集(16000+小时) 中英文 ctc_greedy_search test_net: 0.17378
test_meeting: 0.20505
Librispeech-Test: 0.20888
中英混合: 0.14189
加入知识星球获取
Conformer True fbank 更大数据集(16000+小时) 中英文 ctc_prefix_beam_search test_net: 0.17311
test_meeting: 0.20408
Librispeech-Test: 0.20508
中英混合: 0.14009
加入知识星球获取
Conformer True fbank 更大数据集(16000+小时) 中英文 attention_rescoring test_net: 0.15607
test_meeting: 0.19188
Librispeech-Test: 0.17477
中英混合: 0.12389
加入知识星球获取
Conformer True fbank CommonVoice-Uyghur + THUYG20 维吾尔语 ctc_greedy_search 0.04922 加入知识星球获取
Conformer True fbank CommonVoice-Uyghur + THUYG20 维吾尔语 ctc_prefix_beam_search 0.04793 加入知识星球获取
Conformer True fbank CommonVoice-Uyghur + THUYG20 维吾尔语 attention_rescoring 0.03302 加入知识星球获取

说明:

  1. 这里字错率或者词错率是使用eval.py
  2. 分别给出了使用三个解码器的错误率,其中ctc_prefix_beam_searchattention_rescoring的解码搜索大小为10。
  3. 训练时使用了噪声增强和混响增强,以及其他增强方法,具体请看配置参数configs/augmentation.yml
  4. 这里只提供了流式模型,但全部模型都支持流式和非流式的,在配置文件中streaming参数设置。
  5. 更大数据集准确率比其他的低最主要的是应为训练的epoch太少,但是足以作为其他微调任务的预训练模型。
  6. 使用CommonVoice-Uyghur的测试集作为本项目测试集,其余的和THUYG20全部作为训练集。

有问题欢迎提 issue 交流

文档教程

相关项目

打赏作者


打赏一块钱支持一下作者

打赏作者

参考资料

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

masr-3.0.3-py3-none-any.whl (135.5 kB view details)

Uploaded Python 3

File details

Details for the file masr-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: masr-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 135.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for masr-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3223435afa84afd6255583c9e0b70bd55b2296ef55b569795cce6524c57c45e0
MD5 3f3928a0410ba3e899141f824861f7f0
BLAKE2b-256 41928cd8cd62e29c6b8ec2bd0ae89c3bb21d22e93c5f5fac93d96841c2f054f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page