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_t * | hmmctx
| 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_t * | root_chan
| Search structure of HMM instances. More...
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_t * | rhmm_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). More...
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). More...
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. More...
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. More...
int32 | n_active_word [2]
| Number entries in active_word_list.
lastphn_cand_t * | lastphn_cand
int32 | n_lastphn_cand
last_ltrans_t * | last_ltrans
int32 | cand_sf_alloc
cand_sf_t * | cand_sf
bestbp_rc_t * | bestbp_rc
bptbl_t * | bp_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

## active_chan_list

chan_t*** ngram_search_s::active_chan_list

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.

## active_word_list

int32** ngram_search_s::active_word_list

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.

## homophone_set

int32* ngram_search_s::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).

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.

## root_chan

root_chan_t* ngram_search_s::root_chan

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.

## word_chan

chan_t** ngram_search_s::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).

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_search_free_all_rc().

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

- src/libpocketsphinx/ngram_search.h