1
nl8590687/ASRT_SpeechRecognition
A Deep-Learning-Based Chinese Speech Recognition System 基于深度学习的中文语音识别系统
About nl8590687/ASRT_SpeechRecognition
nl8590687/ASRT_SpeechRecognition is an open-source project on GitHub, mainly written in Python. A Deep-Learning-Based Chinese Speech Recognition System 基于深度学习的中文语音识别系统 It currently holds 8,386 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).
Project Overview
AI Homed tracks it on the AI Audio Projects board and on the AI AI Audio Projects list.
GitHub Repository Details
README

Introduction 简介
本项目使用tensorFlow.keras基于深度卷积神经网络和长短时记忆神经网络、注意力机制以及CTC实现。训练模型的最低软硬件要求
硬件
- CPU: 4核 (x86_64, amd64) +
- RAM: 16 GB +
- GPU: NVIDIA, Graph Memory 11GB+ (1080ti起步)
- 硬盘: 500 GB 机械硬盘(或固态硬盘)
软件
- Linux: Ubuntu 20.04+ / CentOS 7+ (训练+推理) 或 Windows: 10/11(仅推理)
- Python: 3.9 - 3.11 及后续版本
- TensorFlow: 2.5 - 2.11 及后续版本
快速开始
以在Linux系统下的操作为例: 首先通过Git将本项目克隆到您的计算机上,然后下载本项目训练所需要的数据集,下载链接详见文档末尾部分。 ```shell $ git clone https://github.com/nl8590687/ASRT_SpeechRecognition.git ``` 或者您也可以通过 "Fork" 按钮,将本项目Copy一份副本,然后通过您自己的SSH密钥克隆到本地。 通过git克隆仓库以后,进入项目根目录;并创建一个存储数据的子目录, 例如/data/speech_data (可使用软链接代替),然后将下载好的数据集直接解压进去
注意,当前版本中,在配置文件里,默认添加了Thchs30、ST-CMDS、Primewords、aishell-1、aidatatang200、MagicData 六个数据集,如果不需要请自行删除。如果要使用其他数据集需要自行添加数据配置,并提前使用ASRT支持的标准格式整理数据。
```shell
$ cd ASRT_SpeechRecognition
$ mkdir /data/speech_data
$ tar zxf <数据集压缩文件名> -C /data/speech_data/
```
下载默认数据集的拼音标签文件:
```shell
$ python download_default_datalist.py
```
目前可用的模型有24、25、251和251bn
运行本项目之前,请安装必要的Python3版依赖库
本项目开始训练请执行:
```shell
$ python3 train_speech_model.py
```
本项目开始测试请执行:
```shell
$ python3 evaluate_speech_model.py
```
测试之前,请确保代码中填写的模型文件路径存在。
预测单条音频文件的语音识别文本:
```shell
$ python3 predict_speech_file.py
```
启动ASRT HTTP协议的API服务器启动请执行:
```shell
$ python3 asrserver_http.py
```
本地测试调用HTTP协议API服务是否成功:
```shell
$ python3 client_http.py
```
启动ASRT GRPC协议的API服务器启动请执行:
```shell
$ python3 asrserver_grpc.py
```
本地测试调用GRPC协议API服务是否成功:
```shell
$ python3 client_grpc.py
```
请注意,开启API服务器之后,需要使用本ASRT项目对应的客户端软件来进行语音识别,详见Wiki文档下载ASRT语音识别客户端SDK和Demo。
如果要训练和使用非251bn版模型,请在代码中 from speech_model.xxx import xxx 的相应位置做修改。
使用docker直接部署ASRT:
```shell
$ docker pull ailemondocker/asrt_service:1.3.0
$ docker run --rm -it -p 20001:20001 -p 20002:20002 --name asrt-server -d ailemondocker/asrt_service:1.3.0
```
仅CPU运行推理识别,不作训练
Model 模型
Speech Model 语音模型
DCNN + CTC 其中,输入的音频的最大时间长度为16秒,输出为对应的汉语拼音序列- 关于下载已经训练好的模型的问题
Language Model 语言模型
基于概率图的最大熵隐马尔可夫模型 输入为汉语拼音序列,输出为对应的汉字文本About Accuracy 关于准确率
当前,最好的模型在测试集上基本能达到85%的汉语拼音正确率Python依赖库
- tensorFlow (2.5-2.11+)
- numpy
- wave
- matplotlib
- scipy
- requests
- flask
- waitress
- grpcio / grpcio-tools / protobuf
Data Sets 数据集
完整内容请查看:几个最新免费开源的中文语音数据集 |数据集|时长|大小|国内下载|国外下载| |-|-|-|-|-| |THCHS30|40h|6.01G|[data_thchs30.tgz]()|[data_thchs30.tgz]()| |ST-CMDS|100h|7.67G|[ST-CMDS-20170001_1-OS.tar.gz]()|[ST-CMDS-20170001_1-OS.tar.gz]()| |AIShell-1|178h|14.51G|[data_aishell.tgz]()|[data_aishell.tgz]()| |Primewords|100h|8.44G|[primewords_md_2018_set1.tar.gz]()|[primewords_md_2018_set1.tar.gz]()| |MagicData|755h|52G/1.0G/2.2G| [train_set.tar.gz]() / [dev_set.tar.gz]() / [test_set.tar.gz]()|[train_set.tar.gz]() / [dev_set.tar.gz]() / [test_set.tar.gz]()| 注:AISHELL-1 数据集解压方法 ``` $ tar xzf data_aishell.tgz $ cd data_aishell/wav $ for tar in *.tar.gz; do tar xvf $tar; done ``` 特别鸣谢!感谢前辈们的公开语音数据集 如果提供的数据集链接无法打开和下载,请点击该链接 OpenSLRASRT语音识别API客户端调用SDK
ASRT为客户端通过RPC方式调用开发语音识别功能提供了不同平台和编程语言的SDK接入能力,对于其他平台,可直接通过调用通用RESTful Open API方式进行语音识别功能接入。具体接入步骤请看ASRT项目文档。 |客户端平台|项目仓库链接| |-|-| |Windows客户端SDK和Demo|ASRT_SDK_WinClient| |跨平台Python3客户端SDK和Demo|ASRT_SDK_Python3| |跨平台Golang客户端SDK和Demo|asrt-sdk-go| |Java客户端SDK和Demo|ASRT_SDK_Java|ASRT相关资料
ASRT的原理请查看本文: ASRT训练和部署教程请看:- [教你如何使用ASRT训练中文语音识别模型]()
- [教你如何使用ASRT部署中文语音识别API服务器]()
- [[翻译]使用CTC进行序列建模]()
License 开源许可协议
GPL v3.0 © nl8590687 作者:AI柠檬参考引用本项目
DOI: 10.5281/zenodo.5808434Contributors 贡献者们
贡献者页面 @nl8590687 (repo owner)GitHub Stars & Activity
8,386Stars
0Forks
0Open issues
PythonLanguage
GitHub Popularity
GitHub stars8,386
Forks0
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-
Trending History
Trending statusnot on today's boards
Related AI Projects
2
3
4
5
6
7
8