应用HTK建立连续语音识别系统
- 格式:pdf
- 大小:204.19 KB
- 文档页数:18
MatLab环境下调用HTK的连续语音识别方法【摘要】本文根据HTK(HMM Toolkit)的基本原理,在MatLab环境下通过调用HTK各命令实现小词汇量连续语音识别。
采用HTK工具包搭建语音的隐马尔可夫模型(HMM),再利用MatLab循环编程开发进行仿真实验,避免了传统地逐步运行HTK各个命令的冗余操作,降低了操作复杂度。
【关键词】HTK;语音识别;隐马尔可夫模型Abstract:According to the basic principle of HTK(HMM Toolkit),small vocabulary continuous speech was recognized based on HTK by MatLab programming in this thesis.This thesis used HTK to build HMM model and then used MatLab to program it to do speech recognition,thus it avoided the redundancy of operating single HTK command,and the complexity was reduced.as well.Key words:HTK;Speech Recognition;Hidden Markov Model一、引言语言是交流的最自然方式,它为人机交互提供了一种有效的方法。
但目前人与机器的交互方式多以键盘和鼠标为主,为了让机器与人能够更好地进行交互,出现了基于语音识别的系统使人机对话成为可能。
语音识别就是让计算机通过识别和理解把人类的语音信号转换为相应的命令或者文本的一门技术。
HTK(HMM ToolKit)[1][2]工具包是英国剑桥大学专门开发用于建立和处理隐马尔可夫模型的实验工具包,广泛应用在语音识别领域,在语音合成和字符识别等其他领域也有所应用。
第一篇教程概览 1 HTK基础1.1MM基本原理1.2立词识别1.3出概率说明1.4aum-Welch Re-Estimation1.5别和Viterbi解码1.6续语音识别1.7话者适应2 HTK工具包概览2.1TK软件架构2.2TK工具的一般属性2.3具包2.3.1据准备工具2.3.2练工具2.3.3别工具2.3.4析工具2.4本3.4中的更新2.4.1本3.3中的更新2.4.2本3.2中的更新2.4.3本3.1中的更新2.4.4本2.2中的更新2.4.5本2.1中的新特征3 一个教程示例3.1据准备3.1.1骤一任务语法3.1.2骤二字典3.1.3骤三录制语音数据3.1.4骤四创建脚本文件3.1.5骤五语音数据编码3.2建单元音HMM3.2.1骤六创建Flat start单元音3.2.2骤七确定Silence模型3.2.3骤八Realigning训练数据3.3建Tied-Stated三元音3.3.1骤九从单元音创建三元音3.3.2骤十创建Tied-Stated三元音3.4别器评估3.4.1骤十一识别测试数据3.5行识别器3.6MM自适应3.6.1骤十二准备自适应数据3.6.2骤十三生成Transforms(转移矩阵)3.6.3适应系统评估3.7emi-Stated和HLDA Transform3.8结第一章HTK基础HTK是一个用于构建隐马尔可夫模型(HMM)的工具包。
隐马模型可用于对任意时间序列建模,与此类似,HTK的核心部分也是具有通用性的。
然而,HTK主要还是用于构建基于HMM的语音处理工具,特别是语音识别工具。
因此HTK的在基层架构上提供的功能,主要是为了完成这个任务。
如上图所示,这个任务主要由两个阶段构成。
首先,HTK的训练工具基于语音数据和关联的脚本进行HMM参数的估算,其次,未知的语音数据被HTK的识别工具识别,输出识别结果。
本教程主要关注于以上两个处理过程的机制。
然而在深入细节之前,理解HMM的一些基本原理是有必要的,对HTK工具包有一个大概的认识也是有帮助的。
HMM的理论基础一、HMM定义1.N:模型中状态的数目,记t时刻Markov链所处的状态为2.M:每个状态对应的可能的观察数目,记t时刻观察到的观察值为:初始状态概率矢量,,,3.4.A:状态转移概率矩阵,,,5.B:观察值概率矩阵(适用于离散HMM),,,;对于连续分布的HMM,记t时刻的观察值概率为一个离散型的HMM模型可以简约的记为。
二、关于语音识别的HMM的三个基本问题1. 已知观察序列和模型参数,如何有效的计算。
a. 直接计算2-1当N=5,T=100时大概需进行次乘法!b. 前向算法定义t时刻的前向变量(forward variable),可以通过迭代的方法来计算各个时刻的前向变量:1)初始化(Initialization)当t=1时2-2 2)递归(Induction)当时即: 2-33)终结(Termination)2-4 乘法次数大约为:N2Tc. 后向算法定义t时刻的后向变量(backward variable),可以通过迭代的方法来计算各个时刻的后向变量:1)初始化(Initialization)当t=T时, 2-52)递归(Induction)当时即:, 2-63)终结(Termination)2-7 乘法计算次数约为:N2T2. 已知观察序列和模型参数,在最佳意义上确定一个状态序列。
定义一个后验概率变量(posteriori probability variable)2-7 则最优序列可以通过, 2-7求得。
不过,这样求得的最优序列有些问题。
如果,那么这个最优序列本身就不存在。
这里讨论的最佳意义上的最优序列,是使最大化时的确定的状态序列。
即,使最大化时确定的状态序列。
定义为t时刻沿一条路径,且,输出观察序列的最大概率,即:2-8下面介绍迭代计算的Viterbi算法:1)初始化(Initialization),回溯变量:,2)递归(Induction)即: 2-82-93)终结(Termination)2-102-11 4)回溯状态序列, 2-12 3. 已知观察序列和模型参数,如何调整模型参数使最大。
—169—基于HTK 的语音识别网络优化算法杨善茜,黄汉明,蒋正锋,李 锐(广西师范大学计算机科学与信息工程学院,桂林 541004)摘 要:隐马尔可夫模型工具包(HTK)的HParse 命令根据用户以正则表达式形式定义的任务语法来生成HTK 可用的底层表示的语音识别网络,但不是每个语句都能用正则表达式表示出来。
针对该问题,提出基于HTK 的语音识别网络算法用于识别网络的优化问题,给出该算法的具体实现过程。
实验结果表明,在保证识别率的前提下,优化后的语音识别网络在语音识别系统中所用的时间比较短,算法是有效的。
关键词:连续语音识别;自动机;隐马尔可夫模型工具包;语音识别网络HTK-based Optimization Algorithms of Speech Recognition NetworkYANG Shan-xi, HUANG Han-ming, JIANG Zheng-feng, LI Rui(College of Computer Science and Information Technology, Guangxi Normal University, Guilin 541004)【Abstract 】For speech recognition network of Hidden Markov Model ToolKit(HTK) bottom representation is generated by the HParse command module of the HTK according to the form of regular expressions to define the task grammar, but not every language can use regular expressions to express. Aiming at the problem, this paper presents a HTK-based speech recognition network algorithm used to identify the network optimization problem, gives the detailed realization of the algorithm. Experimental results show that the optimized speech recognition network costs less time in speech recognition than the original un-optimized one, while the recognition rate of the two recognition system configurations are almost the same,and verifies the validity of the proposed algorithm.【Key words 】continuous speech recognition; automata; Hidden Markov Model ToolKit(HTK); speech recognition network计 算 机 工 程Computer Engineering 第36卷 第14期Vol.36 No.14 2010年7月July 2010·人工智能及识别技术·文章编号:1000—3428(2010)14—0169—03文献标识码:A中图分类号:TP181 概述在语音识别中,语音识别器可由识别网络、字典和HMM 集构成。
第一章HTK基础HTK是用来创建隐马尔可夫模型(HMMs)的工具集。
HMMs可用来进行任意时间的语音建模,而且HTK的核心是通用的。
HTK首要设计目标是创建基于HMM的语音处理工具,具有特殊功能的识别器。
因此,支持HTK的大部分基础框架都侧重于这项任务。
如上图所示,涉及到两个主要的处理阶段。
首先,HTK训练工具是采用训练声音以及它们相关联的脚本,来建立一套HMM的参数集。
其次,未知的语音可用HTK识别工具转换成文本。
本书的主体设计到以上两个过程的机制。
三是,在进入详细说明钱,应该先了解一些HMMs的基础原理。
这对于我们了解该工具集以及理解HTK如何进行训练和识别过程将非常有帮助。
本书的第一部分尝试提供这些信息。
本章中,将介绍HMMs的基本思想以及在语音识别中如何应用HMMs。
接下来的内容将简单展现HTK的概貌,对于HTK老版本的用户,应重视2.0和后续版本的主要区别。
最后,在本书第三章的实例部分,描述了如果用HTK创建一个基于HMM的语音识别系统。
该实例描述了一个小词汇量连续语音识别系统的构造过程。
本书的第二部分对以上话题进行详细的介绍。
在阅读的过程中可以同时阅读第三部分以及本书的最后部分了解HTK的参考手册,该手册包含了每个工具的描述、概要以及用来配置HTK 各种古铜的参数以及功能在错误情况下产生的一系列的错误提示信息。
最后,注意本书关注的是使用HTK作为工具,并不提供使用HTK库作为编程环境的任何信息。
HMM基本原理图1.1 信息编码/解码语音识别系统普遍假定语音信号是有一个或多个符合组成的符号序列(见图1.1)Speech recognition systems generally assume that the speech signal is a realisation of some message encoded as a sequence of one or more symbols (see Fig. 1.1). To effect the reverse operation of recognising the underlying symbol sequence given a spoken utterance, the continuous speech waveformis first converted to a sequence of equally spaced discrete parameter vectors. This sequence of parameter vectors is assumed to form an exact representation of the speech waveform on the basis that for the duration covered by a single vector (typically 10ms or so), the speech waveform canbe regarded as being stationary. Although this is not strictly true, it is a reasonable approximation. Typical parametric representations in common use are smoothed spectra or linear prediction coefficients plus various other representations derived from these.The rˆole of the recogniser is to effect a mapping between sequences of speech vectors and the wanted underlying symbol sequences. Two problems make this very difficult. Firstly, the mapping from symbols to speech is not one-to-one since different underlying symbols can give rise to similar speech sounds. Furthermore, there are large variations in the realised speech waveform due to speaker variability, mood, environment, etc. Secondly, the boundaries between symbols cannotbe identified explicitly from the speech waveform. Hence, it is not possible to treat the speech waveform as a sequence of concatenated static patterns.The second problem of not knowing the word boundary locations can be avoided by restrictingthe task to isolated word recognition. As shown in Fig. 1.2, this implies that the speech waveform corresponds to a single underlying symbol (e.g. word) chosen from a fixed vocabulary. Despite the fact that this simpler problem is somewhat artificial, it nevertheless has a wide range of practical applications. Furthermore, it serves as a good basis for introducing the basic ideas of HMM-based recognition before dealing with the more complex continuous speech case. Hence, isolated word recognition using HMMs will be dealt with first.。
应用HTK搭建语音拨号系统苏统华哈尔滨工业大学人工智能研究室2006年10月30日声明:版权所有,转载请注明作者和来源该系统能够识别连续说出的数字串和若干组姓名。
建模是针对子词(sub-word, eg. 音素),具有一定的可扩充性。
当加入一个新名字时,只需修改发音词典和任务语法即可。
模型为连续混合高斯输出,运用语音决策树聚类形成的绑定状态式三音素。
1. 数据准备需要录制训练数据和测试数据。
为进行校准,还需要数据的标注文本。
这里用任务语法(task grammar)产生真值文本(ground truth)。
为了处理训练数据,需要定义一个语音集合和一个字典用以涵盖训练和测试数据中涉及的单词。
[step 1]任务语法定义任务语法以包含变量的正则表达式形式定义,存储在文件gram里:文件名:gram$digit = ONE | TWO | THREE | FOUR | FIVE |SIX | SEVEN | EIGHT | NINE | OH | ZERO;$name = [ SUE ] LAW |[ JULIAN ] TYLER |[ DA VE ] WOOD |[ PHIL ] LEE |[ STEVE ] YOUNG;( SENT-START ( DIAL <$digit> | (PHONE|CALL) $name) SENT-END )上面的语法是高层表示,必须通过HParse转成HTK可用的底层表示。
底层表示存于文件wnet中:HParse gram wdnet文件名:wdnetVERSION=1.0N=31 L=62I=0 W=SENT-ENDI=1 W=YOUNG……J=0 S=2 E=0……J=61 S=0 E=29苏统华.哈尔滨工业大学人工智能研究室.2006[step 2]字典定义此例中利用BEEP语音字典,除去其中的重音符,并在每个发音后加入sp(short pause,小停顿)。
收稿日期:2002-09-15;修返日期:2002-12-17基金项目:国家自然科学基金资助项目(69972020);国家基础研究项目(G1998030406);清华大学电子工程系微波与数字通信国家重点实验室项目低速率语音压缩编码对语音识别系统的影响*程 强,崔慧娟,唐 昆(清华大学电子工程系微波与数字通信国家重点实验室,北京100084)摘 要:通过窄带信道将语音信号传输到远端的识别系统,从而实现远距离的人机对话,具有重要的现实意义。
在2.4kbps 的速率下,语音编码算法依然可以合成出可懂度非常高的语音,但是这样的语音信号与原始语音相比还是有巨大的损失。
低速率语音编码算法对于语音识别产生的影响是巨大的,因此必须想办法减轻这种损失对于识别的损害。
在此选择了三种不同的低速率语音编码器,分别使用LPC(Linear Predictive Coding,线性预测)算法、MELP(M i xed Excitation Linear Prediction,混合激励线性预测)算法和I MBE (I mproved Multiband Excitation,增强多带激励)算法,都在2.4kbps 的速率下工作,将其对语音识别系统的影响进行了比较。
对于特定人连续语音识别系统和非特定人连接词识别系统,在使用不同的特征矢量时,不同编码器产生的识别效果有比较大的差异。
实验结果表明,语音编码器和语音识别系统的结构有很重要的联系,尽量采用相近的结构有助于获得良好的识别结果。
另外,改变提取语音识别特征参数的方式也会有利于提高语音识别系统的性能。
关键词:语音编码;语音识别;低速率中图法分类号:TN912.3;TP391.4 文献标识码:A 文章编号:1001-3695(2003)09-0022-04The Influence of Low Bit Rate Speech Coders on Speech Recognition SystemC HE NG Qiang,CUI Hu-i juan,TANG Kun(State K e y Laboratory o f Micro ware &Digital Communication ,Dept.o f Elect ronic Engine ering ,Tsinghua U nive rsity,Be ijing 100084,China )Abstract:Speech recognition through narrow band channel is important in many areas.At the bi t rate as low as 2.4kbps,we can obtain s ynthetic speech with high in telligibili ty by speech coding.However,such speech signal has been damaged severely compared wi th the uncoded one.The low bit rate speech coding has great effect on the following speech recogniti on.So we must find a way to mitigate the damage of coding.We select three low bit rate vocoder workin g at 2.4kbps,using LPC(Linear Predictive Coding),ME LP(Mi xed Excita -tion Linear Prediction)and I MBE(Improved Multi band Exci tation)algorithms respectively,to find the difference of their influences on speech recogni ing different feature vectors,the effect of the vocoders differs on speaker dependent continuous speech recognition and speaker independen t connected di gits recognition.The results of the experimen ts have shown important relation between the algorithm s tructures of the vocoder and recognition system.It is helpful to use si milar structures to improve the recogniti on performance.It will al so be useful to change the way of extracti ng feature parameters for the recogni tion.Key w ords:Speech Coding;Speech Recognition;Low Bi t Rate1 背景介绍在多媒体技术高速发展的今天,语音技术受到越来越多的关注,正迅速地进入人们的生活之中。