PocketSphinx  0.6
ngram_search_s Struct Reference

N-Gram search module structure. More...

#include <ngram_search.h>

Data Fields

ps_search_t base
ngram_model_t * lmset
 Set of language models.
hmm_context_thmmctx
 HMM context.
uint8 fwdtree
uint8 fwdflat
uint8 bestpath
uint8 done
listelem_alloc_t * chan_alloc
 For chan_t.
listelem_alloc_t * root_chan_alloc
 For root_chan_t.
listelem_alloc_t * latnode_alloc
 For latnode_t.
root_chan_troot_chan
 Search structure of HMM instances.
int32 n_root_chan_alloc
 Number of root_chan allocated.
int32 n_root_chan
 Number of valid root_chan.
int32 n_nonroot_chan
 Number of valid non-root channels.
int32 max_nonroot_chan
 Maximum possible number of non-root channels.
root_chan_trhmm_1ph
 Root HMMs for single-phone words.
chan_t ** word_chan
 Channels associated with a given word (only used for right contexts, single-phone words in fwdtree search, and word HMMs in fwdflat search).
bitvec_t * word_active
 array of active flags for all words.
int32 * homophone_set
 Each node in the HMM tree structure may point to a set of words whose last phone would follow that node in the tree structure (but is not included in the tree structure for reasons explained above).
int32 * single_phone_wid
 list of single-phone word ids
int32 n_1ph_words
 Number single phone words in dict (total)
int32 n_1ph_LMwords
 Number single phone dict words also in LM; these come first in single_phone_wid.
chan_t *** active_chan_list
 Array of active channels for current and next frame.
int32 n_active_chan [2]
 Number entries in active_chan_list.
int32 ** active_word_list
 Array of active multi-phone words for current and next frame.
int32 n_active_word [2]
 Number entries in active_word_list.
lastphn_cand_tlastphn_cand
int32 n_lastphn_cand
last_ltrans_tlast_ltrans
int32 cand_sf_alloc
cand_sf_tcand_sf
bestbp_rc_tbestbp_rc
bptbl_tbp_table
int32 bpidx
int32 bp_table_size
int32 * bscore_stack
int32 bss_head
int32 bscore_stack_size
int32 n_frame_alloc
 Number of frames allocated in bp_table_idx and friends.
int32 n_frame
 Number of frames actually present.
int32 * bp_table_idx
int32 * word_lat_idx
ps_latnode_t ** frm_wordlist
 List of active words in each frame.
int32 * fwdflat_wordlist
 List of active word IDs for utterance.
bitvec_t * expand_word_flag
int32 * expand_word_list
int32 n_expand_words
int32 min_ef_width
int32 max_sf_win
float32 fwdflat_fwdtree_lw_ratio
int32 best_score
 Best Viterbi path score.
int32 last_phone_best_score
 Best Viterbi path score for last phone.
int32 renormalized
float32 bestpath_fwdtree_lw_ratio
float32 ascale
 Acoustic score scale for posterior probabilities.
ngram_search_stats_t st
 Various statistics for profiling.
ptmr_t fwdtree_perf
ptmr_t fwdflat_perf
ptmr_t bestpath_perf
int32 n_tot_frame
int32 beam
int32 dynamic_beam
int32 pbeam
int32 wbeam
int32 lpbeam
int32 lponlybeam
int32 fwdflatbeam
int32 fwdflatwbeam
int32 fillpen
int32 silpen
int32 wip
int32 nwpen
int32 pip
int32 maxwpf
int32 maxhmmpf

Detailed Description

N-Gram search module structure.

Definition at line 197 of file ngram_search.h.


Field Documentation

Array of active channels for current and next frame.

In any frame, only some HMM tree nodes are active. active_chan_list[f mod 2] = list of nonroot channels in the HMM tree active in frame f.

Definition at line 275 of file ngram_search.h.

Referenced by ngram_fwdtree_deinit(), and ngram_fwdtree_finish().

Array of active multi-phone words for current and next frame.

Similarly to active_chan_list, active_word_list[f mod 2] = list of word ids for which active channels exist in word_chan in frame f.

Statically allocated single-phone words are always active and should not appear in this list.

Definition at line 287 of file ngram_search.h.

Referenced by ngram_fwdflat_search(), ngram_fwdflat_start(), ngram_fwdtree_finish(), ngram_search_free(), and ngram_search_init().

Acoustic score scale for posterior probabilities.

Definition at line 333 of file ngram_search.h.

List of active words in each frame.

Definition at line 316 of file ngram_search.h.

Referenced by ngram_fwdflat_deinit(), ngram_fwdflat_init(), and ngram_search_mark_bptable().

List of active word IDs for utterance.

Definition at line 317 of file ngram_search.h.

Referenced by ngram_fwdflat_deinit(), ngram_fwdflat_init(), ngram_fwdflat_reinit(), and ngram_fwdflat_search().

Each node in the HMM tree structure may point to a set of words whose last phone would follow that node in the tree structure (but is not included in the tree structure for reasons explained above).

The channel node points to one word in this set of words. The remaining words are linked through homophone_set[].

Single-phone words are not represented in the HMM tree; they are kept in word_chan.

Specifically, homophone_set[w] = wid of next word in the same set as w.

Definition at line 263 of file ngram_search.h.

Best Viterbi path score for last phone.

Definition at line 326 of file ngram_search.h.

ngram_model_t* ngram_search_s::lmset

Set of language models.

Definition at line 199 of file ngram_search.h.

Referenced by ngram_search_free(), ngram_search_init(), and ps_update_lmset().

Number of frames allocated in bp_table_idx and friends.

Definition at line 307 of file ngram_search.h.

Referenced by ngram_fwdflat_init(), ngram_search_init(), and ngram_search_mark_bptable().

Search structure of HMM instances.

The word triphone sequences (HMM instances) are transformed into tree structures, one tree per unique left triphone in the entire dictionary (actually diphone, since its left context varies dyamically during the search process). The entire set of trees of channels is allocated once and for all during initialization (since dynamic management of active CHANs is time consuming), with one exception: the last phones of words, that need multiple right context modelling, are not maintained in this static structure since there are too many of them and few are active at any time. Instead they are maintained as linked lists of CHANs, one list per word, and each CHAN in this set is allocated only on demand and freed if inactive. Roots of search tree.

Definition at line 231 of file ngram_search.h.

Referenced by ngram_fwdtree_finish().

array of active flags for all words.

Definition at line 247 of file ngram_search.h.

Referenced by ngram_fwdflat_finish(), ngram_fwdflat_search(), ngram_fwdtree_finish(), ngram_search_free(), and ngram_search_init().

Channels associated with a given word (only used for right contexts, single-phone words in fwdtree search, and word HMMs in fwdflat search).

WARNING: For single-phone words and fwdflat search, this actually contains pointers to root_chan_t, which are allocated using root_chan_alloc. This is a suboptimal state of affairs.

Definition at line 246 of file ngram_search.h.

Referenced by ngram_fwdflat_reinit(), ngram_fwdflat_start(), ngram_fwdtree_finish(), ngram_fwdtree_reinit(), ngram_fwdtree_start(), ngram_search_alloc_all_rc(), ngram_search_free(), ngram_search_free_all_rc(), and ngram_search_init().


The documentation for this struct was generated from the following file: