summaryrefslogtreecommitdiff
path: root/kaldi_io
diff options
context:
space:
mode:
authorTed Yin <[email protected]>2015-11-23 16:24:18 +0800
committerTed Yin <[email protected]>2015-11-23 16:24:18 +0800
commitf9b78f6bc35cd5c0c117a5e523ef6aab96dee5c3 (patch)
tree87189d673abc5a495101ee9c2ba0d4f9225856e4 /kaldi_io
parentfd2148540efd7a5e5e2c054280d53d3eb3b055cc (diff)
parent24ea90c7a1dd05c2cf43aa7040c504b40ceef965 (diff)
Merge pull request #8 from yimmon/master
add need_key
Diffstat (limited to 'kaldi_io')
-rw-r--r--kaldi_io/init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/kaldi_io/init.lua b/kaldi_io/init.lua
index b7e6da8..e538ee5 100644
--- a/kaldi_io/init.lua
+++ b/kaldi_io/init.lua
@@ -5,6 +5,7 @@ local KaldiReader = nerv.class("nerv.KaldiReader", "nerv.DataReader")
function KaldiReader:__init(global_conf, reader_conf)
self.feat_id = reader_conf.id
self.frm_ext = reader_conf.frm_ext
+ self.need_key = reader_conf.need_key -- for sequence training
self.gconf = global_conf
self.debug = global_conf.debug
if self.debug == nil then
@@ -66,7 +67,9 @@ function KaldiReader:get_data()
rearranged:copy_toh(feat_utter)
end
res[self.feat_id] = feat_utter
- res["key"] = self.feat_repo:key()
+ if self.need_key then
+ res["key"] = self.feat_repo:key()
+ end
-- add corresponding labels
for id, repo in pairs(self.lab_repo) do
local lab_utter = repo:get_utter(self.feat_repo,