Julius 4.2
|
00001 00033 /* 00034 * Copyright (c) 1991-2011 Kawahara Lab., Kyoto University 00035 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00036 * Copyright (c) 2005-2011 Julius project team, Nagoya Institute of Technology 00037 * All rights reserved 00038 */ 00039 00040 #ifndef __J_DEFINE_H__ 00041 #define __J_DEFINE_H__ 00042 00043 00044 /*****************************************************************************/ 00046 /*****************************************************************************/ 00047 00048 /* type of language model */ 00049 #define LM_UNDEF 0 ///< not specified 00050 #define LM_PROB 1 ///< Statistical (N-gram - Julius) 00051 #define LM_DFA 2 ///< DFA (Julian) 00052 00053 /* LM variation specification */ 00054 #define LM_NGRAM 0 ///< N-gram 00055 #define LM_DFA_GRAMMAR 1 ///< DFA grammar 00056 #define LM_DFA_WORD 2 ///< Isolated word recognition 00057 #define LM_NGRAM_USER 3 ///< User-defined statistical LM 00058 00059 /* recognition status */ 00060 #define J_RESULT_STATUS_BUFFER_OVERFLOW -7 ///< Input buffer overflow 00061 #define J_RESULT_STATUS_REJECT_POWER -6 ///< Input rejected by power 00062 #define J_RESULT_STATUS_TERMINATE -5 ///< Input was terminated by app. request 00063 #define J_RESULT_STATUS_ONLY_SILENCE -4 ///< Input contains only silence 00064 #define J_RESULT_STATUS_REJECT_GMM -3 ///< Input rejected by GMM 00065 #define J_RESULT_STATUS_REJECT_SHORT -2 ///< Input rejected by short input 00066 #define J_RESULT_STATUS_FAIL -1 ///< Recognition ended with no candidate 00067 #define J_RESULT_STATUS_SUCCESS 0 ///< Recognition output some result 00068 00069 /* delete incoherent option */ 00070 /* CATEGORY_TREE: DFA=always on, NGRAM=always off */ 00071 /* switch with recog->category_tree */ 00072 /* UNIGRAM_FACTORING: DFA=always off, NGRAM=option */ 00073 /* enclose UNIGRAM_FACTORING section with "if (lmtype == LM_NGRAM)" */ 00074 00075 /* abbreviations for verbose message output */ 00076 #define VERMES if (verbose_flag) jlog 00077 00082 #undef REPORT_MEMORY_USAGE 00083 00084 /*** N-gram tree construction ***/ 00085 /* With 1-best approximation, Constructing a single tree from all words 00086 causes much error by factoring. Listing each word flatly with no 00087 tree-organization will not cause this error, but the network becomes 00088 much larger and, especially, the inter-word LM handling becomes much more 00089 complex (O(n^2)). The cost may be eased by LM caching, but it needs much 00090 memory. */ 00091 /* This is a trade-off of accuracy and cost */ 00092 #define SHORT_WORD_LEN 2 00093 #ifdef LOWMEM 00094 /* don't separate, construct a single tree from all words */ 00095 /* root nodes are about 50 in monophone, cache size will be 5MB on max */ 00096 #define NO_SEPARATE_SHORT_WORD 00097 #else 00098 #ifdef LOWMEM2 00099 /* experimental: separate words frequently appears in corpus (1-gram) */ 00100 /* root nodes will be "-sepnum num" + 50, cache size will be 10MB or so */ 00101 #define NO_SEPARATE_SHORT_WORD 00102 #define SEPARATE_BY_UNIGRAM 00103 #else 00104 /* separate all short words (<= 2 phonemes) */ 00105 /* root nodes are about 1100 in 20k (proportional to vocabulary), 00106 cache size will be about 100MB on max */ 00107 #endif /* LOWMEM2 */ 00108 #endif /* LOWMEM */ 00109 00110 /*#define HASH_CACHE_IW*/ 00111 /* "./configure --enable-lowmem" defines NO_SEPARATE_SHORT_WORD instead */ 00112 00113 /* default language model weight and insertion penalty for pass1 and pass2 */ 00114 /* these values come from the best parameters in IPA evaluation result */ 00115 #define DEFAULT_LM_WEIGHT_MONO_PASS1 5.0 00116 #define DEFAULT_LM_PENALTY_MONO_PASS1 -1.0 00117 #define DEFAULT_LM_WEIGHT_MONO_PASS2 6.0 00118 #define DEFAULT_LM_PENALTY_MONO_PASS2 0.0 00119 #ifdef PASS1_IWCD 00120 #define DEFAULT_LM_WEIGHT_TRI_PASS1 8.0 00121 #define DEFAULT_LM_PENALTY_TRI_PASS1 -2.0 00122 #define DEFAULT_LM_WEIGHT_TRI_PASS2 8.0 00123 #define DEFAULT_LM_PENALTY_TRI_PASS2 -2.0 00124 #else 00125 #define DEFAULT_LM_WEIGHT_TRI_PASS1 9.0 00126 #define DEFAULT_LM_PENALTY_TRI_PASS1 8.0 00127 #define DEFAULT_LM_WEIGHT_TRI_PASS2 11.0 00128 #define DEFAULT_LM_PENALTY_TRI_PASS2 -2.0 00129 #endif /* PASS1_IWCD */ 00130 00131 /* Switch head/tail word insertion penalty to be inserted */ 00132 #undef FIX_PENALTY 00133 00134 /* some definitions for short-pause segmentation */ 00135 #undef SP_BREAK_EVAL /* output messages for evaluation */ 00136 #undef SP_BREAK_DEBUG /* output messages for debug */ 00137 #undef SP_BREAK_RESUME_WORD_BEGIN /* resume word = maxword at beginning of sp area */ 00138 00139 #ifdef GMM_VAD 00140 #define DEFAULT_GMM_MARGIN 20 /* backstep margin / determine buffer length */ 00141 #define GMM_VAD_AUTOSHRINK_LIMIT 500 00142 #undef GMM_VAD_DEBUG /* output debug message */ 00143 #endif 00144 00145 /* default values for spseg_naist */ 00146 #ifdef SPSEGMENT_NAIST 00147 #define DEFAULT_SP_MARGIN 40 00148 #define DEFAULT_SP_DELAY 4 00149 #define SPSEGMENT_NAIST_AUTOSHRINK_LIMIT 500 00150 #endif 00151 00152 /* '01/10/18 by ri: enable fix for trellis lookup order */ 00153 #define PREFER_CENTER_ON_TRELLIS_LOOKUP 00154 00155 /* '01/11/28 by ri: malloc step for startnode for multipath mode */ 00156 #define STARTNODE_STEP 300 00157 00158 /* default dict entry for IW-sp word that will be added to dict with -iwspword */ 00159 #define IWSPENTRY_DEFAULT "<UNK> [sp] sp sp" 00160 00161 /* confidence scoring method */ 00162 #ifdef CONFIDENCE_MEASURE 00163 # ifndef CM_NBEST /* use conventional N-best CM, will be defined if "--enable-cm-nbest" specified */ 00164 # define CM_SEARCH /* otherwise, use on-the-fly CM scoring */ 00165 # endif 00166 #endif 00167 00168 /* dynamic word graph generation */ 00169 #undef GRAPHOUT_SEARCH_CONSIDER_RIGHT /* if defined, only hypothesis whose 00170 left/right contexts is already 00171 included in popped hypo will be merged. 00172 EXPERIMENTAL, should not be defined. 00173 */ 00174 #ifdef CM_SEARCH_LIMIT 00175 #undef CM_SEARCH_LIMIT_AFTER /* enable above only after 1 sentence found */ 00176 #undef CM_SEARCH_LIMIT_POP /* terminate hypo of low CM on pop */ 00177 #endif 00178 00179 /* compute exact boundary instead of using 1st pass result */ 00180 /* also propagate exact time boundary to the right context after generation */ 00181 /* this may produce precise word boundary, but cause bigger word graph output */ 00182 #define GRAPHOUT_PRECISE_BOUNDARY 00183 00184 #undef GDEBUG /* enable debug message in graphout.c */ 00185 00186 /* some decoding fix candidates */ 00187 #undef FIX_35_PASS2_STRICT_SCORE /* fix hypothesis scores by enabling 00188 bt_discount_pescore() in standard mode 00189 with PASS2_STRICT_IWCD, 00190 */ 00191 #define FIX_35_INHIBIT_SAME_WORD_EXPANSION /* privent connecting the same trellis word in 2nd pass */ 00192 00193 00194 /* below are new since 3.5.2 */ 00195 00206 #define GRAPHOUT_OVERWRITE 00207 00208 /* with GRAPHOUT_OVERWRITE, use gscore_head instead of fscore_head */ 00214 #undef GRAPHOUT_OVERWRITE_GSCORE 00215 00222 #define GRAPHOUT_LIMIT_BOUNDARY_LOOP 00223 00236 #define GRAPHOUT_SEARCH_DELAY_TERMINATION 00237 00243 #define GRAPHOUT_DEPTHCUT 00244 00250 #define MINIMAL_BEAM_WIDTH 200 00251 00256 #undef USE_OLD_IWCD 00257 00263 #undef DETERMINE 00264 00265 #define FWD_NGRAM 00266 00267 #define MAX_SPEECH_ALLOC_STEP 320000 00268 00269 00270 #define POWER_REJECT_DEFAULT_THRES 9.0 00271 00276 #undef DEBUG_VTLN_ALPHA_TEST 00277 #define VTLN_RANGE 0.2 00278 #define VTLN_STEP 0.02 00279 00284 #define FAST_FACTOR1_SUCCESSOR_LIST 00285 00290 #define SCORE_PRUNING 00291 00292 #endif /* __J_DEFINE_H__ */ 00293