From c3cbfdc85f26f39c0db66b251da290cfd2100a63 Mon Sep 17 00:00:00 2001 From: dhdfu Date: Mon, 3 May 2010 22:42:14 +0000 Subject: [PATCH] prevent bogus transitions into in fwdtree search - makes lattices more sensible and also improves accuracy a wee bit git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/pocketsphinx@10081 94700074-3cef-4d97-a70e-9c8c206c02f5 --- src/libpocketsphinx/ngram_search_fwdtree.c | 8 ++++++++ test/data/wsj/test-hub4-n800-fwdtree.match | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libpocketsphinx/ngram_search_fwdtree.c b/src/libpocketsphinx/ngram_search_fwdtree.c index 4c43612a..d90f2249 100644 --- a/src/libpocketsphinx/ngram_search_fwdtree.c +++ b/src/libpocketsphinx/ngram_search_fwdtree.c @@ -1341,6 +1341,10 @@ word_transition(ngram_search_t *ngs, int frame_idx) /* Now transition to in-LM single phone words */ for (i = 0; i < ngs->n_1ph_LMwords; i++) { w = ngs->single_phone_wid[i]; + /* Never transition into the start word (for one thing, it is + a non-event in the language model.) */ + if (w == dict_startwid(ps_search_dict(ngs))) + continue; rhmm = (root_chan_t *) ngs->word_chan[w]; newscore = ngs->last_ltrans[w].dscr + ngs->pip + phone_loop_search_score(pls, rhmm->ciphone); @@ -1376,6 +1380,10 @@ word_transition(ngram_search_t *ngs, int frame_idx) for (w = dict_filler_start(dict); w <= dict_filler_end(dict); w++) { if (w == ps_search_silence_wid(ngs)) continue; + /* Never transition into the start word (for one thing, it is + a non-event in the language model.) */ + if (w == dict_startwid(ps_search_dict(ngs))) + continue; rhmm = (root_chan_t *) ngs->word_chan[w]; /* If this was not actually a single-phone word, rhmm will be NULL. */ if (rhmm == NULL) diff --git a/test/data/wsj/test-hub4-n800-fwdtree.match b/test/data/wsj/test-hub4-n800-fwdtree.match index 70bf143e..441489e5 100644 --- a/test/data/wsj/test-hub4-n800-fwdtree.match +++ b/test/data/wsj/test-hub4-n800-fwdtree.match @@ -1,4 +1,4 @@ -at any the need for international managers will keep rising (n800_440c0201 -50651981) +at n. e. c. is needed for international managers will keep rising (n800_440c0201 -50733351) the company has five hundred japanese managers in overseas most of them in key positions in expects the number to rise sixteen %percent to the next five years (n800_440c0202 -93289612) about half of these managers are in the u. s. (n800_440c0203 -34695378) r. l. i. corporation a jury illinois based insurance holding company will begin trading friday on the big board under the symbol r. l. i. (n800_440c0204 -99824669)