From 24ea90c7a1dd05c2cf43aa7040c504b40ceef965 Mon Sep 17 00:00:00 2001 From: Yimmon Zhuang Date: Mon, 23 Nov 2015 16:13:45 +0800 Subject: add need_key --- kaldi_io/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kaldi_io') 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, -- cgit v1.2.3-70-g09d2