惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News | PayPal Newsroom
Application and Cybersecurity Blog
Application and Cybersecurity Blog
O
OpenAI News
S
Security @ Cisco Blogs
宝玉的分享
宝玉的分享
Hacker News: Ask HN
Hacker News: Ask HN
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
Latest news
Latest news
NISL@THU
NISL@THU
S
Security Affairs
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
AI
AI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
小众软件
小众软件
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
AWS News Blog
AWS News Blog
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
I
InfoQ
Schneier on Security
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
The Exploit Database - CXSecurity.com
IT之家
IT之家
T
Threatpost
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
腾讯CDC
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
L
LINUX DO - 最新话题
F
Full Disclosure
大猫的无限游戏
大猫的无限游戏
H
Heimdal Security Blog
S
SegmentFault 最新的问题

Posts on Changkun's Blog

Why High-Output Systems Are Often the First to Stop Growing Dark Forest Theory: A Formal Derivation Agents (or Humans) in Goal-Directed and Goalless Environments: On Pipelines, Priors, and the Rhythm Between Exploration and Exploitation At the Boundary of Self-Reference: From Stable Structures in Artificial Intelligence to the Self as a Recursive Model in an Open Dissipative System 2023 Reading List 2022 Reading List 2021 Reading List Are PSS/USS and RSS Actually the Same Thing? Performance Differences from Page Faults vs. Prefetching 2020 Year-End Review Migration with Zero Downtime 2020 Reading List The All in Go Stack Pointers Might Not Be Ideal for Parameters Eliminating A Source of Measurement Errors in Benchmarks Setup Wordpress in 10 Minutes 我为什么不再写博客了? 2019 年终总结 2018-2019 读书清单 Ten years of blogging Rethinking the Reflections on Communications and Trusts 2018 年终总结 Go source code study is open source Go source study: unsafe Pattern Go source study: sync.Pool Go runtime programming A Million WebSocket and Go Designing Asynchronous RESTful APIs 分布式杂谈01:CAP 理论的误解 Issues of Human-Bot Interaction 压缩法与深度网络的泛化性 Go in 1 Hour UMSLT04: The Past and Present of SGD UMSLT03: A Gentle Start of Learning Theory UMSLT02: A Breif History of Neural Networks UMSLT01: A Breif History of Regularization 不笑不足以为道 论文笔记:Generalization in Deep Learning 2017 年终总结 2017 读书清单 深度学习的泛化理论简介 删除 GitHub 上已经提交的敏感信息 硕士生涯的第一年就这样告一段落了 人肉计算(10): 系统参与激励 人肉计算(9): 陷阱的解法 别聊,一聊你就暴露 人肉计算(8): 人肉计算与数据科学中的陷阱 人肉计算(7): 社会行为分析 Hexo + GitHub + Travis CI + VPS 自动部署 人肉计算(6): 预测市场 人肉计算(5): 信用风险评级模型 读书与回报 瞎扯: 对现代企业理论与当下IT企业的商业模式和信息产业链的规律性的思考 人肉计算(4): 输入数据聚合与PageRank 又一次打整了一下博客 人肉计算(3): 输入数据聚合与链路预测 人肉计算(2): 意图博弈 GWAPs 人肉计算(1): 众包与群众智慧 对后辈同学在计算机专业上的答疑与解惑 在德国的医疗及住院体验 这可能不是一个技术博客了 实验楼楼赛第3期-Python-题解 迅速更换了 DISQUS Electron 深度实践总结 良好的编码体验的三个方面 2016 年终总结 2016 读书清单 最近在着手写的文章 微信小程序文档极致总结 谈谈过去三个月在实验楼的实习经历 Built a Desktop Client for My Blog Guacamole 源码分析与 VNC 中 RFB 协议的坑 《高速上手 C++11/14》正式发布 Docker 极速入门教程02 - 镜像与容器管理 Docker 极速入门教程01 - 基本概念和操作 阶段性沉默 ELK+Redis 最佳实践 终于全面启用了 HTTPS 苹果开源了LZFSE无损压缩 Hash 碰撞的一种思路 记一次完整的 Kaldi-TIMIT 示例运行 Kaldi 安装与部署 从科研写作谈起 Swift API 设计指南 有趣的人类 所以其实论文并没有什么鬼用 Githug 通关记录及指南 小结一下这学期的收获 2015 读书清单 2015 年终总结 负能量爆表 转眼就快两个月了 博客迁移记录 大三总结 这个世界,终究不会是我们的。 Linux 内核分析 之六:Linux 内核创建进程的过程 小说「泽缘」 Linux 内核分析 之五:system_call中断处理过程的简要分析 大创项目的标题真是每年都在考验同学们的想象力啊 Linux 内核分析 之四:使用库函数API和嵌入汇编两种方式使用同一个系统调用
Kaldi 上的 TIMIT 例子
Changkun Ou · 2016-06-04 · via Posts on Changkun's Blog

Published at发布于:   |   PV/UV: /   |   Reading阅读: 3 min

Kaldi 上提供了很多例子让我们学习,这里有一个 Kaldi 上提供例子的列表:

http://kaldi-asr.org/doc/examples.html

但是大部分的数据库来源于LDC,并且需要成为会员才能下载。

我们这里使用一个叫做 TIMIT 的例子,当然他也是需要付费才能使用的数据集。

然而幸运的是我们可以在这个链接里找到所有的内容:

http://www.fon.hum.uva.nl/david/ma_ssp/2007/TIMIT/

因为版权问题我不准备提供直接下载的链接,但是我作为老司机可以指一条路:wget -r,剩下的就看你自己的造化了。

数据拿到后,目录下会多出很多 .html 的文件。我这里写了一个脚本用于删除这些多余的文件,并将小写目录转换成大写目录(在 Kaldi 的 TIMIT 脚本中写出的目录都是大写的):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os

def delHTML(path):
    print "now on" + path + ":"
    for filename in os.listdir(path):
        newpath = path+'/'+filename
        if os.path.isdir(newpath):
            print filename + " is " + str(os.path.isdir(filename))
            delHTML(newpath)
        else:
            if '.html' in filename:
                print "delete: " + filename
                os.remove(newpath)

def renameDIR(path):
    print "now on" + path + ":"
    for filename in os.listdir(path):
        oldpath = path+'/'+filename
        newpath = path+'/'+filename.upper()
        if os.path.isdir(oldpath):
            os.rename(oldpath, newpath)
            print "change to: " + newpath
            renameDIR(newpath)

path = '/path/to/your/TIMIT/data'
delHTML(path)
renameDIR(path)

终于我们获得了一个完整的 TIMIT 的数据集,整个数据集内的文件一共有 666.8 MB。

运行 TIMIT 示例脚本

接下来我们终于可以开始使用 Kaldi 提供的一些例子来跑跑看了。

首先我们需要修改数据集的目录:

1
2
3
4
#timit=/export/corpora5/LDC/LDC93S1/timit/TIMIT # @JHU
#timit=/mnt/matylda2/data/TIMIT/timit # @BUT
# 上面两行是代码中原有的数据集位置,我们需要执行定制为下面的路径:
timit=/path/to/your/TIMIT/data

然后就可以

非常不幸,我们在运行脚本的时候回遇到这样的错误:

1
2
sed: 1: "s:.*/\(.*\)/\(.*\).WAV$ ...": bad flag in substitute command: 'i'
sed: 1: "s:.*/\(.*\)/\(.*\).PHN$ ...": bad flag in substitute command: 'i'

关于这个问题的出现,请参考:http://stackoverflow.com/questions/4412945/case-insensitive-search-replace-with-sed/4412964#4412964,原因在于 Mac 上的 sed 并不是标准的 GNU 实现,所以我们需要安装 GNU sed

我们可以在 Mac 上重新安装 GNU sed 来解决这个问题:

1
brew install gnu-sed --with-default-names

如果你没有 brew 请面壁思过。

安装完成后,我们会得到这样一个错误:

1
2
3
awk: calling undefined function gensub
 input record number 1, file train.text
 source line number 7

又是 Mac 的坑,awk gensub 是 GNU 上的一个扩展,Mac 上没有实现。

装好后,再执行

输出。但是,依然还是有错:

1
2
3
4
5
local/timit_prepare_dict.sh: Error: the IRSTLM is not available or compiled
local/timit_prepare_dict.sh: Error: We used to install it by default, but.
local/timit_prepare_dict.sh: Error: this is no longer the case.
local/timit_prepare_dict.sh: Error: To install it, go to /Users/ouchangkun/Work/Git/kaldi/egs/timit/s5/../../../tools
local/timit_prepare_dict.sh: Error: and run extras/install_irstlm.sh

好吧,我们还要去装 extras/install_irstlm.sh

装完后,我们终于能够完成第一部分的脚本,我们就能够看到

1
Data preparation succeeded

很可惜,我们还是不能完整的运行整个 run.sh 脚本,我们会得到:

这是因为 TIMIT 的这个例子部署在多机器上,我们想要在本地运行所有的任务,需要修改 cmd.sh 中的内容:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

# no GridEngine
export train_cmd=run.pl
export decode_cmd=run.pl
export cuda_cmd=run.pl
export mkgraph_cmd=run.pl

# 下面的内容均为多机器任务的命令,依赖 Sun GridEngine,我们注释掉所有的内容并使用上面的四行。

# export train_cmd="queue.pl --mem 4G"
# export decode_cmd="queue.pl --mem 4G"
# export mkgraph_cmd="queue.pl --mem 8G"

# the use of cuda_cmd is deprecated but it's still sometimes used in nnet1
# example scripts.
# export cuda_cmd="queue.pl --gpu 1"

# the rest of this file is present for historical reasons.
# for cluster-specific configuration it's better to rely on conf/queue.conf.
# if [ "$(hostname)" == "fit.vutbr.cz" ]; then
#   #b) BUT cluster options
#   queue="all.q@@blade,all.q@@speech"
#   gpu_queue="long.q@@gpu"
#   storage="matylda5"
#   export train_cmd="queue.pl -q $queue -l ram_free=1.5G,mem_free=1.5G,${storage}=0.5"
#   export decode_cmd="queue.pl -q $queue -l ram_free=2.5G,mem_free=2.5G,${storage}=0.1"
#   export cuda_cmd="queue.pl -q $gpu_queue -l gpu=1"
# fi

至此,我们再重新运行

便能运行完整个脚本,但是这非常依赖时间,我的本子配置如下:

1
2
3
4
MacBook Pro (Retina, 15-inch, Mid 2014)
2.5 GHz Intel Core i7
16 GB 1600 MHz DDR3
NVIDIA GT750M

运行情况如图所示:

JOB