diff options
author | Ted Yin <[email protected]> | 2015-11-23 16:24:18 +0800 |
---|---|---|
committer | Ted Yin <[email protected]> | 2015-11-23 16:24:18 +0800 |
commit | f9b78f6bc35cd5c0c117a5e523ef6aab96dee5c3 (patch) | |
tree | 87189d673abc5a495101ee9c2ba0d4f9225856e4 | |
parent | fd2148540efd7a5e5e2c054280d53d3eb3b055cc (diff) | |
parent | 24ea90c7a1dd05c2cf43aa7040c504b40ceef965 (diff) |
Merge pull request #8 from yimmon/master
add need_key
-rw-r--r-- | kaldi_io/init.lua | 5 |
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, |