#include <stdio.h>
#include <profile.h>
#include <s3types.h>
#include <lm.h>
#include <kbcore.h>
#include <vithist.h>
#include <word_ugprob.h>
#include <word_graph.h>
#include <whmm.h>
#include <hmm.h>
#include <ctxt_table.h>
#include <dict.h>
Go to the source code of this file.
Classes | |
struct | fwd_dbg_t |
struct | backoff_t |
struct | word_cand_s |
struct | srch_FLAT_FWD_graph_s |
Typedefs | |
typedef struct word_cand_s | word_cand_t |
typedef struct srch_FLAT_FWD_graph_s | srch_FLAT_FWD_graph_t |
Functions | |
void | build_word_cand_cf (int32 cf, dict_t *dict, s3wid_t *wcand_cf, int32 word_cand_win, word_cand_t **wcand) |
int32 | word_cand_load (FILE *fp, word_cand_t **wcand, dict_t *dict, char *uttid) |
void | word_cand_free (word_cand_t **wcand) |
int32 | whmm_eval (srch_FLAT_FWD_graph_t *fwg, int32 *senscr) |
void | dump_all_whmm (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 n_frm, int32 *senscr) |
void | dump_all_word (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm) |
void | whmm_renorm (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 bestscr) |
void | whmm_transition (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 w, whmm_t *h) |
void | word_enter (srch_FLAT_FWD_graph_t *fwg, s3wid_t w, int32 score, s3latid_t l, s3cipid_t lc) |
void | whmm_exit (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, latticehist_t *lathist, int32 thresh, int32 wordthresh, int32 phone_penalty) |
void | word_trans (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, latticehist_t *lathist, int32 thresh, int32 phone_penalty) |
void | flat_fwd_dag_add_fudge_edges (srch_FLAT_FWD_graph_t *fwg, dag_t *dagp, int32 fudge, int32 min_ef_range, void *hist, dict_t *dict) |
typedef struct srch_FLAT_FWD_graph_s srch_FLAT_FWD_graph_t |
typedef struct word_cand_s word_cand_t |
void build_word_cand_cf | ( | int32 | cf, | |
dict_t * | dict, | |||
s3wid_t * | wcand_cf, | |||
int32 | word_cand_win, | |||
word_cand_t ** | wcand | |||
) |
Build array of candidate words that start around the current frame (cf). Note: filler words are not in this list since they are always searched (see word_trans).
cf | Current frame | |
dict | The dictionary | |
wcand_cf | The array of word candidate | |
word_cand_win | In frame f, candidate words in input lattice from frames [(f - word_cand_win) .. (f + word_cand_win)] will be the actual candidates to be started(entered) |
References BAD_S3WID, dict_t::filler_start, dict_t::finishwid, dict_t::n_word, word_cand_s::next, S3_MAX_FRAMES, dict_t::startwid, and word_cand_s::wid.
Referenced by word_trans().
void dump_all_whmm | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm, | |||
int32 | n_frm, | |||
int32 * | senscr | |||
) |
References dump_whmm(), srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_mdef, kbcore_tmat, and dict_t::n_word.
void dump_all_word | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm | |||
) |
void flat_fwd_dag_add_fudge_edges | ( | srch_FLAT_FWD_graph_t * | fwg, | |
dag_t * | dagp, | |||
int32 | fudge, | |||
int32 | min_ef_range, | |||
void * | hist, | |||
dict_t * | dict | |||
) |
References dagnode_s::alloc_next, BAD_S3WID, srch_FLAT_FWD_graph_s::ctxt, dag_link(), dagnode_s::fef, dict_t::finishwid, latticehist_t::frm_latstart, dag_t::fudged, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_fillpen, kbcore_lm, lat_seg_ascr_lscr(), latticehist_t::lattice, dagnode_s::lef, dag_t::list, dagnode_s::sf, and dagnode_s::wid.
int32 whmm_eval | ( | srch_FLAT_FWD_graph_t * | fwg, | |
int32 * | senscr | |||
) |
Evaluate one frame in a whmm (mostly a wrapper around hmm_vit_eval())
References srch_FLAT_FWD_graph_s::ctr_mpx_whmm, srch_FLAT_FWD_graph_s::ctr_nonmpx_whmm, hmm_context_set_senscore, hmm_frame, hmm_is_mpx, hmm_vit_eval(), srch_FLAT_FWD_graph_s::hmmctx, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_mdef, kbcore_tmat, srch_FLAT_FWD_graph_s::n_frm, dict_t::n_word, S3_LOGPROB_ZERO, srch_FLAT_FWD_graph_s::whmm, and whmm_free().
void whmm_exit | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm, | |||
latticehist_t * | lathist, | |||
int32 | thresh, | |||
int32 | wordthresh, | |||
int32 | phone_penalty | |||
) |
void whmm_renorm | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm, | |||
int32 | bestscr | |||
) |
void whmm_transition | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm, | |||
int32 | w, | |||
whmm_t * | h | |||
) |
Transition from hmm h into the next appropriate one for word w. Threshold check for incoming score already completed. The next HMM may be the last triphone for the word w, in which case, instantiate multiple instances corresponding cross-word triphone modelling for all right context ciphones.
References dictword_t::ciphone, srch_FLAT_FWD_graph_s::ctxt, ctxt_table_word_int_ssid, FALSE, get_rcssid(), hmm_enter(), hmm_in_score, hmm_out_history, hmm_out_score, srch_FLAT_FWD_graph_s::hmmctx, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_tmat, srch_FLAT_FWD_graph_s::n_frm, word_ugprob_s::next, dictword_t::pronlen, whmm_alloc(), and dict_t::word.
Referenced by whmm_exit().
void word_cand_free | ( | word_cand_t ** | wcand | ) |
Free word candidate
wcand | list of word candidate to free |
References word_cand_s::next, word_ugprob_s::next, and S3_MAX_FRAMES.
int32 word_cand_load | ( | FILE * | fp, | |
word_cand_t ** | wcand, | |||
dict_t * | dict, | |||
char * | uttid | |||
) |
Load word candidate into a list
fp | An initialized for inputfile poiner | |
wcand | list of word candidate | |
dict | The dictionary | |
uttid | The ID of an utterance |
References dict_basewid, dict_wordid(), word_cand_s::next, NOT_S3WID, S3_MAX_FRAMES, and word_cand_s::wid.
void word_enter | ( | srch_FLAT_FWD_graph_t * | fwg, | |
s3wid_t | w, | |||
int32 | score, | |||
s3latid_t | l, | |||
s3cipid_t | lc | |||
) |
Transition into a word w. Since we transition into the first phone position, the triphone model must be derived from the incoming left context ciphone. The first state of the whmm instance inherits this triphone model and propagates it along with the score. If the first phone is also the last (single-phone word), we must also model all possible right context ciphones, by instantiating separate whmm models for each rc.
References dictword_t::ciphone, ct_get_rc_nssid(), srch_FLAT_FWD_graph_s::ctxt, ctxt_table_left_ctxt_ssid, ctxt_table_single_phone_ssid, get_lc_cimap(), hmm_enter(), hmm_in_score, hmm_is_mpx, hmm_mpx_ssid, hmm_nonmpx_ssid, srch_FLAT_FWD_graph_s::hmmctx, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_tmat, ctxt_table_t::lrcssid, srch_FLAT_FWD_graph_s::n_frm, dictword_t::pronlen, xwdssid_t::ssid, TRUE, srch_FLAT_FWD_graph_s::whmm, whmm_alloc(), and dict_t::word.
Referenced by word_trans().
void word_trans | ( | srch_FLAT_FWD_graph_t * | fwg, | |
whmm_t ** | whmm, | |||
latticehist_t * | lathist, | |||
int32 | thresh, | |||
int32 | phone_penalty | |||
) |
Transition for one word.
ARCHAN: This is the heart of the flat forward search. When a word is exited, n_lat_entry will be increased by 1, this will implicitly trigger fwd_frame() to start word_trans (this function). Word trans will consider all word ends. They should be now all entries in lattice_t (which is very similar to vithist_entry_t if you look at them closely).
References dictword_t::alt, build_word_cand_cf(), dictword_t::ciphone, srch_FLAT_FWD_graph_s::ctxt, dict_basewid, srch_FLAT_FWD_graph_s::filler_backoff, dict_t::filler_start, fillpen(), dict_t::finishwid, latticehist_t::frm_latstart, get_rc_cimap(), IS_S3WID, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_fillpen, kbcore_mdef, backoff_t::latid, latticehist_t::lattice, backoff_t::lc, lm_uglist(), LM_UGPROB, mdef_t::n_ciphone, srch_FLAT_FWD_graph_s::n_frm, latticehist_t::n_lat_entry, srch_FLAT_FWD_graph_s::n_word_cand, dictword_t::pronlen, srch_FLAT_FWD_graph_s::rcscore, S3_LOGPROB_ZERO, backoff_t::score, dict_t::startwid, srch_FLAT_FWD_graph_s::ug_backoff, dict_t::word, srch_FLAT_FWD_graph_s::word_cand, srch_FLAT_FWD_graph_s::word_cand_cf, srch_FLAT_FWD_graph_s::word_cand_win, word_enter(), and srch_FLAT_FWD_graph_s::word_ugprob.