Skip to content

Latest commit

 

History

History
139 lines (96 loc) · 6.27 KB

README_CN.md

File metadata and controls

139 lines (96 loc) · 6.27 KB

WeNet

English version

License Python-Version

文档 | 训练模型教程 | WeNet 论文 | x86 识别服务 | android 本地识别

核心功能

WeNet 是一款面向工业落地应用的语音识别工具包,提供了从语音识别模型的训练到部署的一条龙服务,其主要特点如下:

  • 使用 conformer 网络结构和 CTC/attention loss 联合优化方法,统一的流式/非流式语音识别方案,具有业界一流的识别效果。
  • 提供云上和端上直接部署的方案,最小化模型训练和产品落地之间的工程工作。
  • 框架简洁,模型训练部分完全基于 pytorch 生态,不依赖于 kaldi 等复杂的工具。
  • 详细的注释和文档,非常适合用于学习端到端语音识别的基础知识和实现细节。
  • 支持时间戳,对齐,端点检测,语言模型等相关功能。

1分钟 Demo

使用预训练模型和 docker 进行语音识别,1分钟(如果网速够快)搭建一个语音识别系统

下载官方提供的预训练模型,并启动 docker 服务,加载模型,提供 websocket 协议的语音识别服务。

wget http://mobvoi-speech-public.ufile.ucloud.cn/public/wenet/aishell2/20210602_unified_transformer_server.tar.gz
tar -xf 20210602_unified_transformer_server.tar.gz
model_dir=$PWD/20210602_unified_transformer_server
docker run --rm -it -p 10086:10086 -v $model_dir:/home/wenet/model mobvoiwenet/wenet:mini bash /home/run.sh

实时识别

使用浏览器打开文件wenet/runtime/server/x86/web/templates/index.html,在 WebSocket URL 中填入 ws://127.0.0.1:10086, 允许浏览器弹出的请求使用麦克风,即可通过麦克风进行实时语音识别。

Runtime web

训练语音识别模型

配置环境

git clone https://github.com/wenet-e2e/wenet.git
conda create -n wenet python=3.8
conda activate wenet
pip install -r requirements.txt
conda install pytorch==1.6.0 cudatoolkit=10.1 torchaudio=0.6.0 -c pytorch

# GPU 3090
conda create -n wenet python=3.8
conda activate wenet
pip install -r requirements.txt
conda install pytorch torchvision torchaudio=0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

训练模型

使用中文 Aishell-1 数据集训练模型

cd examples/aishell/s0/
bash run.sh --stage -1

细节请阅读 训练模型教程

WeNet 性能

WeNet 提供了一些开源数据集的脚本,具体的模型性能如下,注意其中提供的预训练模型为 pytorch 训练时使用的模型,并非 runtime 模型。runtime 模型需要进行导出操作。

技术支持

欢迎在 Github Issues 中提交问题。

欢迎扫二维码加入微信讨论群,如果群人数较多,请添加右侧个人微信入群。

贡献者列表

致谢

WeNet 借鉴了一些优秀的开源项目,包括

  1. Transformer 建模 ESPnet
  2. WFST 解码 Kaldi
  3. TLG 构图 EESEN
  4. Python Batch 推理 OpenTransformer

引用

@inproceedings{yao2021wenet,
  title={WeNet: Production oriented Streaming and Non-streaming End-to-End Speech Recognition Toolkit},
  author={Yao, Zhuoyuan and Wu, Di and Wang, Xiong and Zhang, Binbin and Yu, Fan and Yang, Chao and Peng, Zhendong and Chen, Xiaoyu and Xie, Lei and Lei, Xin},
  booktitle={Proc. Interspeech},
  year={2021},
  address={Brno, Czech Republic }
  organization={IEEE}
}

@article{zhang2020unified,
  title={Unified Streaming and Non-streaming Two-pass End-to-end Model for Speech Recognition},
  author={Zhang, Binbin and Wu, Di and Yao, Zhuoyuan and Wang, Xiong and Yu, Fan and Yang, Chao and Guo, Liyong and Hu, Yaguang and Xie, Lei and Lei, Xin},
  journal={arXiv preprint arXiv:2012.05481},
  year={2020}
}

@article{wu2021u2++,
  title={U2++: Unified Two-pass Bidirectional End-to-end Model for Speech Recognition},
  author={Wu, Di and Zhang, Binbin and Yang, Chao and Peng, Zhendong and Xia, Wenjing and Chen, Xiaoyu and Lei, Xin},
  journal={arXiv preprint arXiv:2106.05642},
  year={2021}
}