summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimmon Zhuang <[email protected]>2015-11-23 16:13:45 +0800
committerYimmon Zhuang <[email protected]>2015-11-23 16:13:45 +0800
commit24ea90c7a1dd05c2cf43aa7040c504b40ceef965 (patch)
tree87189d673abc5a495101ee9c2ba0d4f9225856e4
parentb33b3a6732c6b6a66bd5c44c615be56d66f4ed67 (diff)
add need_key
-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,