summaryrefslogtreecommitdiff
path: root/kaldi_io/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'kaldi_io/init.lua')
-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,