WeNet

生产优先和生产就绪端到端语音识别工具包。「Production First and Production Ready End-to-End Speech Recognition Toolkit」

Github星跟蹤圖

WeNet

License
Python-Version

Roadmap
| Docs
| Papers
| Runtime
| Pretrained Models
| HuggingFace
| Ask WeNet Guru

We share Net together.

Highlights

  • Production first and production ready: The core design principle, WeNet provides full stack production solutions for speech recognition.
  • Accurate: WeNet achieves SOTA results on a lot of public speech datasets.
  • Light weight: WeNet is easy to install, easy to use, well designed, and well documented.

Install

Install python package

pip install git+https://github.com/wenet-e2e/wenet.git

Command-line usage (use -h for parameters):

wenet --language chinese audio.wav

Python programming usage:

import wenet

model = wenet.load_model('chinese')
result = model.transcribe('audio.wav')
print(result['text'])

Please refer python usage for more command line and python programming usage.

Install for training & deployment

  • Clone the repo
git clone https://github.com/wenet-e2e/wenet.git
conda create -n wenet python=3.10
conda activate wenet
conda install conda-forge::sox
  • Install CUDA: please follow this link, It's recommended to install CUDA 12.1
  • Install torch and torchaudio, It's recomended to use 2.2.2+cu121:
pip install torch==2.2.2+cu121 torchaudio==2.2.2+cu121 -f https://download.pytorch.org/whl/torch_stable.html
  • Install CANN: please follow this link to install CANN toolkit and kernels.

  • Install WeNet with torch-npu dependencies:

pip install -e .[torch-npu]
  • Related version control table:
Requirement Minimum Recommend
CANN 8.0.RC2.alpha003 latest
torch 2.1.0 2.2.0
torch-npu 2.1.0 2.2.0
torchaudio 2.1.0 2.2.0
deepspeed 0.13.2 latest
  • Install other python packages
pip install -r requirements.txt
pre-commit install  # for clean and tidy code
  • Frequently Asked Questions (FAQs)
# If you encounter sox compatibility issues
RuntimeError: set_buffer_size requires sox extension which is not available.
# ubuntu
sudo apt-get install sox libsox-dev
# centos
sudo yum install sox sox-devel
# conda env
conda install  conda-forge::sox

Build for deployment

Optionally, if you want to use x86 runtime or language model(LM),
you have to build the runtime as follows. Otherwise, you can just ignore this step.

# runtime build requires cmake 3.14 or above
cd runtime/libtorch
mkdir build && cd build && cmake -DGRAPH_TOOLS=ON .. && cmake --build .

Please see doc for building
runtime on more platforms and OS.

Discussion & Communication

You can directly discuss on Github Issues.

For Chinese users, you can also scan the QR code on the left to follow our official account of WeNet.
We created a WeChat group for better discussion and quicker response.
Please scan the personal QR code on the right, and the guy is responsible for inviting you to the chat group.

Acknowledge

  1. We borrowed a lot of code from ESPnet for transformer based modeling.
  2. We borrowed a lot of code from Kaldi for WFST based decoding for LM integration.
  3. We referred EESEN for building TLG based graph for LM integration.
  4. We referred to OpenTransformer for python batch inference of e2e models.

Citations

@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{zhang2022wenet,
  title={WeNet 2.0: More Productive End-to-End Speech Recognition Toolkit},
  author={Zhang, Binbin and Wu, Di and Peng, Zhendong and Song, Xingchen and Yao, Zhuoyuan and Lv, Hang and Xie, Lei and Yang, Chao and Pan, Fuping and Niu, Jianwei},
  journal={arXiv preprint arXiv:2203.15455},
  year={2022}
}

主要指標

概覽
名稱與所有者wenet-e2e/wenet
主編程語言Python
編程語言Python (語言數: 17)
平台
許可證Apache License 2.0
所有者活动
創建於2020-11-17 03:57:23
推送於2025-07-12 03:00:24
最后一次提交
發布數12
最新版本名稱v3.1.0 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數4.7k
關注者數92
派生數1.1k
提交數1.6k
已啟用問題?
問題數1105
打開的問題數15
拉請求數1319
打開的拉請求數18
關閉的拉請求數227
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?