查看: 2014|回复: 2

语音识别学习记录 [kaldi中的openfst]

[复制链接]

665

主题

1234

帖子

6575

积分

xdtech

Rank: 5Rank: 5

积分
6575
发表于 2019-1-15 10:45:15 | 显示全部楼层 |阅读模式
本帖最后由 shaoheshaohe 于 2019-1-15 10:46 编辑

先来介绍一下这个例子,再来说明FST(finite-state transducers,有限状态机)如何应用到语音识别中。

首先有三个文件,text.fst、isyms.txt、osyms.txt。

text.fst文件的内容为(请无视前面的行号):

0 1 a x .5
0 1 b y 1.5
1 2 c z 2.5
2 3.5
前三行是FST中的弧(arc),格式为[ 起点(src),终点(dest),输入标签(ilabel),输出标签(olabel) ,权重(weight)];弧在文件中的顺序可以交换,但是初始状态的弧必须在第一行。最后一行为最终状态的编号和最终状态的权值。这个文件描述的是FST的结构,根据这个文件可以得到下图:

1.jpg

从上图可以看出字符串ac到xz的转换的权重为0.5+2.5+3.5=6.5.

关于这个图的说明放一段openFst教程中的原话:The initial state is label 0. There can only be one initial state. The final state is 2 with final weight of 3.5. Any state with non-infinite final weight is a final state. There is an arc (or transition) from state 0 to 1 with input label a, output label x, and weight 0.5. This FST transduces, for instance, the string ac to xz with weight 6.5 (the sum of the arc and final weights). Note we have assumed the library default Weight type for this description.

isyms.txt文件内容为:

<eps> 0
a 1
b 2
c 3
osyms.txt文件内容为:

<eps> 0
x 1
y 2
z 3
isyms.txt和osyms.txt是输入标签和输出标签对应的符号。因为FST的输入标签和输出标签在内部都是用数字表示的,所以要有这么两个符号表。可以使用任意的非负整数作为符号的ID。那个为0的标签ID是为epsilon标签保存的,epsilon是一个空字符串。上面的例子中并没有用到epsilon这个标签,openFST的教程上面说以后会用到,具体干什么我也还不清楚。
---------------------
作者:WePlayDirty
来源:CSDN
原文:https://blog.csdn.net/u013569304/article/details/81560521
版权声明:本文为博主原创文章,转载请附上博文链接!

回复

使用道具 举报

38

主题

84

帖子

243

积分

中级会员

Rank: 3Rank: 3

积分
243
发表于 2019-1-16 09:07:59 | 显示全部楼层
fst的安装
一直出问题
简直是想死的心啊
回复

使用道具 举报

38

主题

84

帖子

243

积分

中级会员

Rank: 3Rank: 3

积分
243
发表于 2019-1-16 09:08:23 | 显示全部楼层
明明已经安装了
却在报
command not found
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表