sumom****@users*****
sumom****@users*****
2010年 1月 5日 (火) 11:59:38 JST
Index: julius4/libjulius/src/beam.c diff -u julius4/libjulius/src/beam.c:1.12 julius4/libjulius/src/beam.c:1.13 --- julius4/libjulius/src/beam.c:1.12 Fri Jun 12 00:21:38 2009 +++ julius4/libjulius/src/beam.c Tue Jan 5 11:59:38 2010 @@ -42,7 +42,7 @@ * @author Akinobu LEE * @date Tue Feb 22 17:00:45 2005 * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * */ /* @@ -1703,11 +1703,15 @@ newid = create_token(d); new = &(d->tlist[d->tn][newid]); new->last_tre = &(d->bos); +#ifdef FIX_PENALTY new->last_lscore = 0.0; +#else + new->last_lscore = d->penalty1; +#endif if (wchmm->hmminfo->multipath) { - new->score = 0.0; + new->score = new->last_lscore; } else { - new->score = outprob_style(wchmm, node, d->bos.wid, 0, param); + new->score = outprob_style(wchmm, node, d->bos.wid, 0, param) + new->last_lscore; } node_assign_token(d, node, newid); } Index: julius4/libjulius/src/dfa_decode.c diff -u julius4/libjulius/src/dfa_decode.c:1.2 julius4/libjulius/src/dfa_decode.c:1.3 --- julius4/libjulius/src/dfa_decode.c:1.2 Tue Dec 18 17:45:49 2007 +++ julius4/libjulius/src/dfa_decode.c Tue Jan 5 11:59:38 2010 @@ -47,7 +47,7 @@ * @author Akinobu LEE * @date Mon Mar 7 15:31:00 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -111,7 +111,11 @@ nw[num]->id = dfa->term.tw[cate][iw]; /* word ID */ nw[num]->next_state = ns; /* next state */ nw[num]->can_insert_sp = FALSE; /* short pause should not inserted before this word */ +#ifdef FIX_PENALTY + nw[num]->lscore = 0.0; +#else nw[num]->lscore = r->config->lmp.penalty2; +#endif num++; if (num >= maxnw) return -1; /* buffer overflow */ } Index: julius4/libjulius/src/ngram_decode.c diff -u julius4/libjulius/src/ngram_decode.c:1.4 julius4/libjulius/src/ngram_decode.c:1.5 --- julius4/libjulius/src/ngram_decode.c:1.4 Sat Jul 4 23:11:42 2009 +++ julius4/libjulius/src/ngram_decode.c Tue Jan 5 11:59:38 2010 @@ -35,7 +35,7 @@ * @author Akinobu Lee * @date Fri Jul 8 14:57:51 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -513,10 +513,13 @@ nw[0]->id = r->lm->winfo->tail_silwid; } -#ifdef FIX_PENALTY - nw[0]->lscore = 0.0; -#else - nw[0]->lscore = r->config->lmp.lm_penalty2; + nw[0]->lscore = uni_prob(r->wchmm->ngram, r->wchmm->winfo->wton[nw[0]->id]); +#ifdef CLASS_NGRAM + nw[0]->lscore += r->wchmm->winfo->cprob[nw[0]->id]; +#endif + nw[0]->lscore *= r->config->lmp.lm_weight2; +#ifndef FIX_PENALTY + nw[0]->lscore += r->config->lmp.lm_penalty2; #endif return 1; /* number of words = 1 */ Index: julius4/libjulius/src/search_bestfirst_v1.c diff -u julius4/libjulius/src/search_bestfirst_v1.c:1.4 julius4/libjulius/src/search_bestfirst_v1.c:1.5 --- julius4/libjulius/src/search_bestfirst_v1.c:1.4 Fri Feb 15 03:25:14 2008 +++ julius4/libjulius/src/search_bestfirst_v1.c Tue Jan 5 11:59:38 2010 @@ -92,7 +92,7 @@ * @author Akinobu Lee * @date Sun Sep 11 23:54:53 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -1462,11 +1462,8 @@ } - if (r->lmtype == LM_PROB) { - new->lscore = nword->lscore; - } else if (r->lmtype == LM_DFA) { - new->lscore = 0.0; - } + /* 接続確率を与える */ + new->lscore = nword->lscore; if (! hmminfo->multipath) { /* a_value: 接続点の遷移確率 */ @@ -1642,11 +1639,7 @@ } new->lscore = nword->lscore; - if (r->lmtype == LM_PROB) { - new->g[peseqlen-1] = nword->lscore; - } else if (r->lmtype == LM_DFA) { - new->g[peseqlen-1] = 0; - } + new->g[peseqlen-1] = nword->lscore; for (t=peseqlen-1; t>=0; t--) { tre = bt_binsearch_atom(backtrellis, t, word); Index: julius4/libjulius/src/search_bestfirst_v2.c diff -u julius4/libjulius/src/search_bestfirst_v2.c:1.4 julius4/libjulius/src/search_bestfirst_v2.c:1.5 --- julius4/libjulius/src/search_bestfirst_v2.c:1.4 Fri Feb 15 03:25:14 2008 +++ julius4/libjulius/src/search_bestfirst_v2.c Tue Jan 5 11:59:38 2010 @@ -48,7 +48,7 @@ * @author Akinobu Lee * @date Mon Sep 12 00:58:50 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -1394,11 +1394,7 @@ new->last_ph = NULL; } - if (r->lmtype == LM_PROB) { - new->g[peseqlen-1] = nword->lscore; - } else { - new->g[peseqlen-1] = 0; - } + new->g[peseqlen-1] = nword->lscore; for (t=peseqlen-1; t>=0; t--) { tre = bt_binsearch_atom(backtrellis, t, word);