diff options
author | Eric Bi <[email protected]> | 2015-12-01 17:03:39 +0800 |
---|---|---|
committer | Eric Bi <[email protected]> | 2015-12-01 17:03:39 +0800 |
commit | 119f9091ea60d81efabd7d20ff2490b9e7084778 (patch) | |
tree | d8e059138204e0dc4cc31d7936df6f7775a94dc8 /kaldi_io/init.lua | |
parent | f9b78f6bc35cd5c0c117a5e523ef6aab96dee5c3 (diff) |
add detection of utterances without alignment, and skip them
Diffstat (limited to 'kaldi_io/init.lua')
-rw-r--r-- | kaldi_io/init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kaldi_io/init.lua b/kaldi_io/init.lua index e538ee5..5193504 100644 --- a/kaldi_io/init.lua +++ b/kaldi_io/init.lua @@ -36,6 +36,7 @@ function KaldiReader:__init(global_conf, reader_conf) end function KaldiReader:get_data() + local fail_to_read_alignment = false if self.feat_repo:is_end() then return nil end @@ -75,6 +76,9 @@ function KaldiReader:get_data() local lab_utter = repo:get_utter(self.feat_repo, feat_utter:nrow(), self.debug) + if lab_utter == nil then + fail_to_read_alignment = true + end res[id] = lab_utter end -- add corresponding lookup features @@ -98,5 +102,9 @@ function KaldiReader:get_data() -- move the pointer to next self.feat_repo:next() collectgarbage("collect") + if fail_to_read_alignment then + nerv.info("[Kaldi IO] utterance %s alignment not found, skip it.", self.feat_repo:key()) + res = self:get_data() + end return res end |