Julius 4.2
libjulius/src/default.c
説明を見る。
00001 
00023 /*
00024  * Copyright (c) 1991-2011 Kawahara Lab., Kyoto University
00025  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00026  * Copyright (c) 2005-2011 Julius project team, Nagoya Institute of Technology
00027  * All rights reserved
00028  */
00029 
00030 #include <julius/julius.h>
00031 
00056 void
00057 jconf_set_default_values(Jconf *j)
00058 {
00059   j->input.type                         = INPUT_VECTOR;
00060   j->input.speech_input                 = SP_MFCFILE;
00061   j->input.device                       = SP_INPUT_DEFAULT;
00062   j->input.plugin_source                = -1;
00063   j->input.sfreq                        = 16000;
00064   j->input.period                       = 625;
00065   j->input.framesize                    = DEF_FRAMESIZE;
00066   j->input.frameshift                   = DEF_FRAMESHIFT;
00067   j->input.use_ds48to16                 = FALSE;
00068   j->input.inputlist_filename           = NULL;
00069   j->input.adinnet_port                 = ADINNET_PORT;
00070 #ifdef USE_NETAUDIO
00071   j->input.netaudio_devname             = NULL;
00072 #endif
00073   j->input.paramtype_check_flag         = TRUE;
00074 
00075   j->detect.level_thres                 = 2000;
00076   j->detect.head_margin_msec            = 300;
00077   j->detect.tail_margin_msec            = 400;
00078   j->detect.zero_cross_num              = 60;
00079   j->detect.silence_cut                 = 2; /* accept device default */
00080 #ifdef GMM_VAD
00081   j->detect.gmm_margin                  = DEFAULT_GMM_MARGIN;
00082   j->detect.gmm_uptrigger_thres         = 0.7;
00083   j->detect.gmm_downtrigger_thres       = -0.2;
00084 #endif
00085 
00086   j->preprocess.strip_zero_sample       = TRUE;
00087   j->preprocess.use_zmean               = FALSE;
00088 
00089   j->reject.gmm_filename                = NULL;
00090   j->reject.gmm_gprune_num              = 10;
00091   j->reject.gmm_reject_cmn_string       = NULL;
00092   j->reject.rejectshortlen              = 0;
00093 #ifdef POWER_REJECT
00094   j->reject.powerthres                  = POWER_REJECT_DEFAULT_THRES;
00095 #endif
00096 
00097   j->decodeopt.forced_realtime          = FALSE;
00098   j->decodeopt.force_realtime_flag      = FALSE;
00099   j->decodeopt.segment                  = FALSE;
00100 
00101   j->optsection                         = JCONF_OPT_DEFAULT;
00102   j->optsectioning                      = TRUE;
00103 }
00104 
00121 void
00122 jconf_set_default_values_am(JCONF_AM *j)
00123 {
00124   j->name[0] = '\0';
00125 
00126   j->hmmfilename                        = NULL;
00127   j->mapfilename                        = NULL;
00128   j->gprune_method                      = GPRUNE_SEL_UNDEF;
00129   j->mixnum_thres                       = 2;
00130   j->spmodel_name                       = NULL;
00131   j->hmm_gs_filename                    = NULL;
00132   j->gs_statenum                        = 24;
00133   j->iwcdmethod                         = IWCD_UNDEF;
00134   j->iwcdmaxn                           = 3;
00135   j->iwsp_penalty                       = -1.0;
00136   j->force_multipath                    = FALSE;
00137   undef_para(&(j->analysis.para));
00138   undef_para(&(j->analysis.para_hmm));
00139   undef_para(&(j->analysis.para_default));
00140   undef_para(&(j->analysis.para_htk));
00141   make_default_para(&(j->analysis.para_default));
00142   make_default_para_htk(&(j->analysis.para_htk));
00143   j->analysis.cmnload_filename          = NULL;
00144   j->analysis.cmn_update                = TRUE;
00145   j->analysis.cmnsave_filename          = NULL;
00146   j->analysis.cmn_map_weight            = 100.0;
00147   j->frontend.ss_alpha                  = DEF_SSALPHA;
00148   j->frontend.ss_floor                  = DEF_SSFLOOR;
00149   j->frontend.sscalc                    = FALSE;
00150   j->frontend.sscalc_len                = 300;
00151   j->frontend.ssload_filename           = NULL;
00152 }
00153 
00170 void
00171 jconf_set_default_values_lm(JCONF_LM *j)
00172 {
00173   j->name[0] = '\0';
00174 
00175   j->lmtype = LM_UNDEF;
00176   j->lmvar  = LM_UNDEF;
00177   j->dictfilename                       = NULL;
00178   j->head_silname                       = NULL;
00179   j->tail_silname                       = NULL;
00180   j->forcedict_flag                     = FALSE;
00181   j->ngram_filename                     = NULL;
00182   j->ngram_filename_lr_arpa             = NULL;
00183   j->ngram_filename_rl_arpa             = NULL;
00184   j->dfa_filename                       = NULL;
00185   j->gramlist_root                      = NULL;
00186   j->wordlist_root                      = NULL;
00187   j->enable_iwsp                        = FALSE;
00188   j->enable_iwspword                    = FALSE;
00189   j->iwspentry                          = NULL;
00190 #ifdef SEPARATE_BY_UNIGRAM
00191   j->separate_wnum                      = 150;
00192 #endif
00193   strcpy(j->wordrecog_head_silence_model_name, "silB");
00194   strcpy(j->wordrecog_tail_silence_model_name, "silE");
00195   j->wordrecog_silence_context_name[0] = '\0';
00196   strcpy(j->unknown_name, UNK_WORD_DEFAULT); // or UNK_WORD_DEFAULT2
00197   j->additional_dict_files              = NULL;
00198   j->additional_dict_entries            = NULL;
00199 }
00200 
00217 void
00218 jconf_set_default_values_search(JCONF_SEARCH *j)
00219 {
00220   j->name[0] = '\0';
00221 
00222   j->amconf = NULL;
00223   j->lmconf = NULL;
00224   j->compute_only_1pass                 = FALSE;
00225   j->force_ccd_handling                 = FALSE;
00226   j->ccd_handling                       = FALSE;
00227   /* 
00228     default values below are assigned later using HMM information:
00229         j->lmp.*
00230   */
00231   j->lmp.lm_penalty_trans               = 0.0;
00232   j->lmp.penalty1                       = 0.0;
00233   j->lmp.penalty2                       = 0.0;
00234   j->lmp.lmp2_specified                 = FALSE;
00235   j->lmp.lmp_specified                  = FALSE;
00236 
00237   j->pass1.specified_trellis_beam_width = -1;
00238 #ifdef SCORE_PRUNING
00239   j->pass1.score_pruning_width          = -1.0;
00240 #endif
00241 #if defined(WPAIR) && defined(WPAIR_KEEP_NLIMIT)
00242   j->pass1.wpair_keep_nlimit            = 3;
00243 #endif
00244 #ifdef HASH_CACHE_IW
00245   j->pass1.iw_cache_rate                = 10;
00246 #endif
00247   j->pass1.old_tree_function_flag = FALSE;
00248 #ifdef DETERMINE
00249   j->pass1.determine_score_thres = 10.0;
00250   j->pass1.determine_duration_thres = 6;
00251 #endif
00252   if (strmatch(JULIUS_SETUP, "fast")) {
00253     j->pass2.nbest              = 1;
00254     j->pass2.enveloped_bestfirst_width = 30;
00255   } else {
00256     j->pass2.nbest              = 10;
00257     j->pass2.enveloped_bestfirst_width = 100;
00258   }
00259 #ifdef SCAN_BEAM
00260   j->pass2.scan_beam_thres      = 80.0;
00261 #endif
00262   j->pass2.hypo_overflow                = 2000;
00263   j->pass2.stack_size           = 500;
00264   j->pass2.lookup_range         = 5;
00265   j->pass2.looktrellis_flag     = FALSE; /* dfa */
00266 
00267   j->graph.enabled                      = FALSE;
00268   j->graph.lattice                      = FALSE;
00269   j->graph.confnet                      = FALSE;
00270   j->graph.graph_merge_neighbor_range   = 0;
00271 #ifdef   GRAPHOUT_DEPTHCUT
00272   j->graph.graphout_cut_depth           = 80;
00273 #endif
00274 #ifdef   GRAPHOUT_LIMIT_BOUNDARY_LOOP
00275   j->graph.graphout_limit_boundary_loop_num = 20;
00276 #endif
00277 #ifdef   GRAPHOUT_SEARCH_DELAY_TERMINATION
00278   j->graph.graphout_search_delay        = FALSE;
00279 #endif
00280   j->successive.enabled                 = FALSE;
00281   j->successive.sp_frame_duration       = 10;
00282   j->successive.pausemodelname          = NULL;
00283 #ifdef SPSEGMENT_NAIST
00284   j->successive.sp_margin               = DEFAULT_SP_MARGIN;
00285   j->successive.sp_delay                = DEFAULT_SP_DELAY;
00286 #endif
00287 #ifdef CONFIDENCE_MEASURE
00288   j->annotate.cm_alpha                  = 0.05;
00289 #ifdef   CM_MULTIPLE_ALPHA
00290   j->annotate.cm_alpha_bgn              = 0.03;
00291   j->annotate.cm_alpha_end              = 0.15;
00292   j->annotate.cm_alpha_num              = 5;
00293   j->annotate.cm_alpha_step             = 0.03;
00294 #endif
00295 #ifdef   CM_SEARCH_LIMIT
00296   j->annotate.cm_cut_thres              = 0.03;
00297 #endif
00298 #ifdef   CM_SEARCH_LIMIT_POPO
00299   j->annotate.cm_cut_thres_pop          = 0.1;
00300 #endif
00301 #endif /* CONFIDENCE_MEASURE */
00302   j->annotate.align_result_word_flag    = FALSE;
00303   j->annotate.align_result_phoneme_flag = FALSE;
00304   j->annotate.align_result_state_flag   = FALSE;
00305 
00306   j->output.output_hypo_maxnum          = 1;
00307   j->output.progout_flag                = FALSE;
00308   j->output.progout_interval            = 300;
00309   j->output.multigramout_flag           = FALSE; /* dfa */
00310   
00311   j->sw.trellis_check_flag              = FALSE;
00312   j->sw.triphone_check_flag             = FALSE;
00313   j->sw.wchmm_check_flag                = FALSE;
00314   j->sw.start_inactive                  = FALSE;
00315   j->sw.fallback_pass1_flag             = FALSE;
00316 }
00317 
00318 /* end of file */