jconf.h

来自「julius version 4.12.about sound recognit」· C头文件 代码 · 共 1,202 行 · 第 1/2 页

H
1,202
字号
/** * @file   jconf.h *  * <JA> * @brief  Jconf 菇陇挛の年盗 * * </JA> *  * <EN> * @brief  Jconf structure * * </EN> *  * <pre> * JCONF *   +- JCONF_AM[] (linked list) *   +- JCONF_LM[] (linked list) *   +- JCONF_SEARCH[] (linked list) -> each has pointer to *JCONF_AM, *JCONF_LM *   +- JCONF_AM for GMM *   +- (engine configurations) * </pre> *  * @author Akinobu Lee * @date   Fri Feb 16 13:42:28 2007 * * $Revision: 1.8 $ *  *//* * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology * All rights reserved *//**/#ifndef __J_JCONF_H__#define __J_JCONF_H__#include <sent/stddefs.h>#include <sent/hmm.h>#include <sent/vocabulary.h>#include <sent/ngram2.h>#include <sent/dfa.h>#include <sent/mfcc.h>#include <julius/wchmm.h>#include <julius/search.h>#include <julius/callback.h>/** * Maximum length of module name string *  */#define JCONF_MODULENAME_MAXLEN 64/** * Default module name if not specified (in case of old jconf) *  */#define JCONF_MODULENAME_DEFAULT "_default"/** * Configuration parameters (AM) *  */typedef struct __jconf_am__ {  /**   * Unique ID   *    */  short id;  /**   * Unique name   *    */  char name[JCONF_MODULENAME_MAXLEN];  /**   * HMM definition file (-h)   */  char *hmmfilename;  /**   * HMMList file to map logical (tri)phones to physical models (-hlist)   */  char *mapfilename;  /**   * Gaussian pruning method (-gprune)   * Default: use value from compile-time engine configuration default.   */  int gprune_method;  /**   * Number of Gaussian to compute per mixture on Gaussian pruning (-tmix)     */  int mixnum_thres;     /**   * Logical HMM name of short pause model (-spmodel)   * Default: "sp"   */  char *spmodel_name;  /**   * GMS: HMM definition file for GMS (-gshmm)   */  char *hmm_gs_filename;  /**   * GMS: number of mixture PDF to select (-gsnum)   */  int gs_statenum;      /**   * Calculation method for outprob score of a lcdset on cross-word   * triphone (-iwcd1)    */  short iwcdmethod;    /**   * N-best states to be calculated on IWCD_NBEST (-iwcd1 best N)   */  short iwcdmaxn;  /**   * Transition penalty of inter-word short pause (-iwsppenalty)   * for multi-path mode   */  LOGPROB iwsp_penalty;   /**   * force multipath mode   *    */  boolean force_multipath;  /**   * Acoustic Analysis Conditions.  Parameter setting priority is:   * user-specified > specified HTK Config > model-embedded > Julius default.   *    */  struct {    /**     * All MFCC computation parameters, actually used for recognition.     */    Value para;             /**     * default parameters of Julius     */    Value para_default;    /**     * parameters from binhmm header     */    Value para_hmm;                 /**     * parameters from HTK Config (-htkconf)     */    Value para_htk;         /**     * CMN: load initial cepstral mean from file at startup (-cmnload)     */    char *cmnload_filename;    /**     * CMN: update cepstral mean while recognition     * (-cmnnoupdate to unset)     */    boolean cmn_update;    /**     * CMN: save cepstral mean to file at end of every recognition (-cmnsave)     */    char *cmnsave_filename;         /**     * CMN: MAP weight for initial cepstral mean on (-cmnmapweight)     */    float cmn_map_weight;  } analysis;  /**   * Frontend processing parameter for this AM   *    */  struct {    /**     * Alpha coefficient for spectral subtraction     *      */    float ss_alpha;    /**     * Flooring coefficient for spectral subtraction     *      */    float ss_floor;    /**     * SS: compute noise spectrum from head silence on file input (-sscalc)     */    boolean sscalc;    /**     * With "-sscalc", specify noise length at input head in msec (-sscalclen)     */    int sscalc_len;    /**     * Load noise spectrum data from file (-ssload), that was made by "mkss".     */    char *ssload_filename;  } frontend;  /**   * Plugin source ID when using plugin (gprune_method is GPRUNE_SEL_USER)   */  int gprune_plugin_source;  /* pointer to next instance */  struct __jconf_am__ *next;} JCONF_AM;/** * Language models (N-gram / DFA), dictionary, and related parameters. *  */typedef struct __jconf_lm__ {  /**   * Unique ID   *    */  short id;  /**   * Unique name   *    */  char name[JCONF_MODULENAME_MAXLEN];  /**   * Language model type: one of LM_UNDEF, LM_NGRAM, LM_DFA   *    */  int lmtype;  /**   * Variation type of language model: one of LM_NGRAM, LM_DFA_GRAMMAR,   * LM_DFA_WORD   *    */  int lmvar;  /**   * Word dictionary file (-v)   */  char *dictfilename;    /**   * Silence word to be placed at beginning of speech (-silhead) for N-gram   */  char *head_silname;  /**   * Silence word to be placed at end of search (-siltail) for N-gram   */  char *tail_silname;    /**   * Skip error words in dictionary and continue (-forcedict)   */  boolean forcedict_flag;    /**   * N-gram in binary format (-d)   */  char *ngram_filename;  /**   * LR 2-gram in ARPA format (-nlr)   */  char *ngram_filename_lr_arpa;  /**   * RL 3-gram in ARPA format (-nrl)   */  char *ngram_filename_rl_arpa;    /**   * DFA grammar file (-dfa, for single use)   */  char *dfa_filename;    /**   * List of grammars to be read at startup (-gram) (-gramlist)   */  GRAMLIST *gramlist_root;    /**   * List of word lists to be read at startup (-w) (-wlist)   */  GRAMLIST *wordlist_root;    /**   * Enable inter-word short pause handling on multi-path version (-iwsp)   * for multi-path mode   */  boolean enable_iwsp;     /**   * Enable automatic addition of "short pause word" to the dictionary   * (-iwspword) for N-gram   */  boolean enable_iwspword;  /**   * Dictionary entry to be added on "-iwspword" (-iwspentry) for N-gram   */  char *iwspentry;  #ifdef SEPARATE_BY_UNIGRAM  /**   * Number of best frequency words to be separated (linearized)   * from lexicon tree (-sepnum)   */  int separate_wnum;#endif  /**   * For isolated word recognition mode: name of head silence model   */  char wordrecog_head_silence_model_name[MAX_HMMNAME_LEN];  /**   * For isolated word recognition mode: name of tail silence model   */  char wordrecog_tail_silence_model_name[MAX_HMMNAME_LEN];  /**   * For isolated word recognition mode: name of silence as phone context   */  char wordrecog_silence_context_name[MAX_HMMNAME_LEN];  /**   * Name string of Unknown word for N-gram   */  char unknown_name[UNK_WORD_MAXLEN];  /**   * Pointer to next instance   *    */  struct __jconf_lm__ *next;  } JCONF_LM;/** * Search parameters *  */typedef struct __jconf_search__ {  /**   * Unique ID   *    */  short id;  /**   * Unique name   *    */  char name[JCONF_MODULENAME_MAXLEN];  /**   * Which AM configuration to refer   *    */  JCONF_AM *amconf;  /**   * Which LM configuration to refer   *    */  JCONF_LM *lmconf;  /**   * Compute only 1pass (-1pass)   */  boolean compute_only_1pass;      /**   * context handling   */  boolean ccd_handling;      /**   * force context-dependent handling   */  boolean force_ccd_handling;  /**   * LM weights   *    */  struct {    /**     * N-gram Language model weight (-lmp)     */    LOGPROB lm_weight;      /**     * N-gram Word insertion penalty (-lmp)     */    LOGPROB lm_penalty;     /**   * N-gram Language model weight for 2nd pass (-lmp2)   */    LOGPROB lm_weight2;     /**     * N-gram Word insertion penalty for 2nd pass (-lmp2)     */    LOGPROB lm_penalty2;            /**     * N-gram Additional insertion penalty for transparent words (-transp)     */    LOGPROB lm_penalty_trans;        /**     * Word insertion penalty for DFA grammar on 1st pass (-penalty1)     */    LOGPROB penalty1;    /**     * Word insertion penalty for DFA grammar on 2nd pass (-penalty2)     */    LOGPROB penalty2;        /**     * INTERNAL: TRUE if -lmp2 specified     */    boolean lmp2_specified;        /**     * INTERNAL: TRUE if -lmp specified     */    boolean lmp_specified;  } lmp;      /**   * First pass parameters   *    */  struct {    /**     * Beam width of 1st pass. If value is -1 (not specified), system     * will guess the value from dictionary size.  If 0, a possible     * maximum value will be assigned to do full search.     */    int specified_trellis_beam_width;    #if defined(WPAIR) && defined(WPAIR_KEEP_NLIMIT)    /**     * Keeps only N token on word-pair approximation (-nlimit)     */    int wpair_keep_nlimit;#endif#ifdef HASH_CACHE_IW    /**     * Inter-word LM cache size rate (-iwcache)     */    int iw_cache_rate;#endif    /**     * (DEBUG) use old build_wchmm() instead of build_wchmm2() for lexicon     * construction (-oldtree)     */    boolean old_tree_function_flag;#ifdef DETERMINE    /**     * (EXPERIMENTAL) score threshold between maximum node score and     * maximum word end score for early word determination     *      */    LOGPROB determine_score_thres;    /**     * (EXPERIMENTAL) frame duration threshold for early word determination     *      */    int determine_duration_thres;#endif /* DETERMINE */  } pass1;  /**   * Second pass parameters   *    */  struct {    /**     * Search until N-best sentences are found (-n). Also see "-output".     */    int nbest;                    /**     * Word beam width of 2nd pass. -1 means no beaming (-b2)     */    int enveloped_bestfirst_width;#ifdef SCAN_BEAM    /**     * Score beam threshold of 2nd pass (-sb)     */    LOGPROB scan_beam_thres;#endif    /**     * Hypothesis overflow threshold at 2nd pass (-m)     */    int hypo_overflow;    /**     * Hypothesis stack size of 2nd pass (-s)     */    int stack_size;    /**     * Get next words from word trellis with a range of this frames     * on 2nd pass (-lookuprange)     */    int lookup_range;        /**     * Limit expansion words for trellis words on neighbor frames     * at 2nd pass of DFA for speedup (-looktrellis)     */    boolean looktrellis_flag;      } pass2;  /**   * Word graph output   *    */  struct {    /**     * GraphOut: if enabled, graph search is enabled.     *      */    boolean enabled;    /**     * GraphOut: if enabled, output word graph     *      */    boolean lattice;    /**     * GraphOut: if enabled, generate confusion network     *      */    boolean confnet;    /**     * GraphOut: allowed margin for post-merging on word graph generation     * (-graphrange) if set to -1, same word with different phone context     * will be separated.     */    int graph_merge_neighbor_range;#ifdef   GRAPHOUT_DEPTHCUT    /**     * GraphOut: density threshold to cut word graph at post-processing.     * (-graphcut)  Setting larger value is safe for all condition.     */    int graphout_cut_depth;#endif#ifdef   GRAPHOUT_LIMIT_BOUNDARY_LOOP    /**     * GraphOut: limitation of iteration loop for word boundary adjustment     * (-graphboundloop)     */    int graphout_limit_boundary_loop_num;#endif#ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION    /**     * GraphOut: delay the termination of search on graph merging until     * at least one sentence candidate is found     * (-graphsearchdelay / -nographsearchdelay)     */    boolean graphout_search_delay;#endif  } graph;    /**   * Successive decoding (--enable-sp-segment)   *    */  struct {    /**     * TRUE if short-pause segmentation enabled for this instance     *      */    boolean enabled;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?