用pytorch+CTC+WFST实现汉语语音识别

最近,我留出了很多时间来写我一直犹豫要写的智力理论,并做了一些语音识别的实验,所以我有了这个项目。

[En]

Recently, I have set aside a lot of time to write the intelligence theory that I have been hesitant to write, and to do some experiments with speech recognition, so I have this project.

语音识别实验比可选的工具有kaldi,wav2letter,espnet等,使用比较广泛工具是kaldi,但是对于前端语音处理的部分,我觉得kaldi所使用的HMM-GMM方式相当的不直观,Kaldi所使用的nnet神经网络也不是目前主流的深度学习工具。而kaldi创建者Daniel Povey要推出的与pytorch接口良好的kaldi新的版本也还没有出来。但是kaldi的WFST解码系统在处理文本模型的表现相当的出色,我想要的工具是pytorch处理语音前端,再加上WFST处理文本模型。
我在网上找了一下,找到了一个项目比较满足我的需求,它就是github上的eesen(https://github.com/isi-vista/eesen),eesen和传统kaldi处理方式对比如下:
传统的kaldi处理方式:
• Hidden Markov models (HMMs)
• Gaussian mixture models (GMMs)
• Decision trees and phonetic questions
• Dictionary, if characters are used as the modeling units
• …

eesen的处理方式:
• Acoustic Model — Bi-directional RNNs with LSTM units.

• Training — Connectionist temporal classification (CTC) as the training objective.

• Decoding — A principled decoding approach based on Weighted Finite-State Transducers (WFSTs).

eesen项目最近的更新已经是两年前,所使用的依赖库也比较早期,对于神经网络的处理还是使用nnet,所使用的例子也是英文。所以在github上我又参考了两个相关的项目,一个是ctc-asr(https://github.com/placebokkk/ctc-asr)和 eesen-for-thchs30(https://github.com/Sundy1219/eesen-for-thchs30),经过一段时间的调试,我做了第一个实验,语音处理前端使用pytorch处理,其输出是基于拼音的概率矩阵,然后用WFST处理得到文字输出。
注意:首先要安装好eesen,由于这个项目时间久远,支持的库比较老,我折腾了好久,我目前在ubuntu16.04上编译成功,cuda使用的9.2版本,pytorch我使用anaconda安装,使用版本的是python3.7,pytorch1.2,cuda9.2。
使用的实验语料是清华实验室提供的thchs30,安装好后首先要在before_run.sh中设置好thchs30语料的所在的目录,然后运行run-ctc.sh,如果要继续训练,需要将exp/train*/model/final.pt 复制到exp/init.pt,然后运行train_continue.sh.

项目访问地址https://github.com/lixinyu2001/eesen-pytorch-thchs30

Original: https://blog.csdn.net/m0_37135912/article/details/119259481
Author: lixinyu99
Title: 用pytorch+CTC+WFST实现汉语语音识别

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/512848/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球