Exemplo n.º 1
0
/** 
 * <JA>
 * エンジンインスタンスの全情報をログに出力する. 
 * </JA>
 * <EN>
 * Output all informations of an engine instance to log.
 * </EN>
 *
 * @param recog [in] engine instance
 * 
 * @callgraph
 * @callergraph
 */
void
print_engine_info(Recog *recog)
{
  FILE *fp;
  Jconf *jconf;
  MFCCCalc *mfcc;
  PROCESS_AM *am;
  PROCESS_LM *lm;
  RecogProcess *r;

  jconf = recog->jconf;
  
  /* set output file pointer to fp */
  fp = jlog_get_fp();
  if (fp == NULL) return;

  jlog("----------------------- System Information begin ---------------------\n");
  j_put_header(fp);
  j_put_compile_defs(fp);
  jlog("\n");
  
  /* print current argument setting to log */
  print_jconf_overview(jconf);

  if (jconf->input.type == INPUT_WAVEFORM) {

    /* acoustic parameter conditions for this model */
    jlog("------------------------------------------------------------\n");
    jlog("Speech Analysis Module(s)\n\n");
    
    for(mfcc=recog->mfcclist;mfcc;mfcc=mfcc->next) {

      jlog("[MFCC%02d]  for", mfcc->id);
      for(am=recog->amlist;am;am=am->next) {
	if (am->mfcc == mfcc) {
	  jlog(" [AM%02d %s]", am->config->id, am->config->name);
	}
      }
      if (recog->gmm != NULL) {
	if (recog->gmmmfcc == mfcc) {
	  jlog(" [GMM]");
	}
      }
      jlog("\n\n");

      put_para(fp, mfcc->para);

      if (jconf->input.type == INPUT_WAVEFORM) {
	jlog("    spectral subtraction = ");
	if (mfcc->frontend.ssload_filename || mfcc->frontend.sscalc) {
	  if (mfcc->frontend.sscalc) {
	    jlog("use head silence of each input\n");
	    jlog("\t     head sil length = %d msec\n", mfcc->frontend.sscalc_len);
	  } else {			/* ssload_filename != NULL */
	    jlog("use a constant value from file\n");
	    jlog("         noise spectrum file = \"%s\"\n", mfcc->frontend.ssload_filename);
	  }
	  jlog("\t         alpha coef. = %f\n", mfcc->frontend.ss_alpha);
	  jlog("\t      spectral floor = %f\n", mfcc->frontend.ss_floor);
	} else {
	  jlog("off\n");
	}
      }
      jlog("  cepstral normalization = ");
      if (mfcc->para->cmn || mfcc->para->cvn) {
	if (jconf->decodeopt.realtime_flag) {
	  jlog("real-time MAP-");
	} else {
	  jlog("sentence ");
	}
	if (mfcc->para->cmn) {
	  jlog("CMN");
	}
	if (mfcc->para->cmn && mfcc->para->cvn) {
	  jlog("+");
	}
	if (mfcc->para->cvn) {
	  jlog("CVN");
	}
	jlog("\n");
      } else {
	jlog("no\n");
      }
      jlog("\t base setup from =");
      if (mfcc->htk_loaded == 1 || mfcc->hmm_loaded == 1) {
	if (mfcc->hmm_loaded == 1) {
	  jlog(" binhmm-embedded");
	  if (mfcc->htk_loaded == 1) {
	    jlog(", then overridden by HTK Config and defaults");
	  }
	} else {
	  if (mfcc->htk_loaded == 1) {
	    jlog(" HTK Config (and HTK defaults)");
	  }
	}
      } else {
	jlog(" Julius defaults");
      }
      jlog("\n");

      jlog("\n");

      if (jconf->decodeopt.realtime_flag && (mfcc->para->cmn || mfcc->para->cvn)) {
	jlog(" MAP-");
	if (mfcc->para->cmn) jlog("CMN");
	if (mfcc->para->cmn && mfcc->para->cvn) jlog("+");
	if (mfcc->para->cvn) jlog("CVN");
	jlog(":\n");
	jlog("      initial cep. data   = ");
	if (mfcc->cmn.load_filename) {
	  jlog("load from \"%s\"\n", mfcc->cmn.load_filename);
	} else {
	  jlog("none\n");
	}
	jlog("      beginning data weight = %6.2f\n", mfcc->cmn.map_weight);
	if (mfcc->cmn.update) {
	  jlog("    beginning data update = yes, from last inputs at each input\n");
	} else {
	  jlog("    beginning data update = no, use default as initial at each input\n");
	}
	if (mfcc->cmn.save_filename) {
	  jlog("        save cep. data to = file \"%s\" at end of each input\n", mfcc->cmn.save_filename);
	}
	jlog("\n");
      }
    }
  }


  if (recog->gmm != NULL) {
    jlog("------------------------------------------------------------\n");
    jlog("GMM\n");
    jlog("\n");
    jlog("     GMM definition file = %s\n", jconf->reject.gmm_filename);
    jlog("          GMM gprune num = %d\n", jconf->reject.gmm_gprune_num);
    if (jconf->reject.gmm_reject_cmn_string != NULL) {
      jlog("     GMM names to reject = %s\n", jconf->reject.gmm_reject_cmn_string);
    }
#ifdef GMM_VAD
    jlog("\n GMM-based VAD\n\n");
    jlog("       backstep on trigger = %d frames\n", jconf->detect.gmm_margin);
    jlog("    up-trigger thres score = %.1f\n", jconf->detect.gmm_uptrigger_thres);
    jlog("  down-trigger thres score = %.1f\n", jconf->detect.gmm_downtrigger_thres);
#endif
    jlog("\n GMM");
    print_hmmdef_info(fp, recog->gmm);
    jlog("\n");
  }

  jlog("------------------------------------------------------------\n");
  jlog("Acoustic Model(s)\n");
  jlog("\n");

  for(am = recog->amlist; am; am = am->next) {
    if (am->config->name[0] != '\0') {
      jlog("[AM%02d \"%s\"]\n\n", am->config->id, am->config->name);
    } else {
      jlog("[AM%02d]\n\n", am->config->id);
    }
    print_hmmdef_info(fp, am->hmminfo);
    jlog("\n");
    if (am->config->hmm_gs_filename != NULL) {
      jlog("GS ");
      print_hmmdef_info(fp, am->hmm_gs);
      jlog("\n");
    }

    jlog(" AM Parameters:\n");

    jlog("        Gaussian pruning = ");
    switch(am->config->gprune_method){
    case GPRUNE_SEL_NONE: jlog("none (full computation)"); break;
    case GPRUNE_SEL_BEAM: jlog("beam"); break;
    case GPRUNE_SEL_HEURISTIC: jlog("heuristic"); break;
    case GPRUNE_SEL_SAFE: jlog("safe"); break;
    case GPRUNE_SEL_USER: jlog("(use plugin function)"); break;
    }
    jlog("  (-gprune)\n");
    if (am->config->gprune_method != GPRUNE_SEL_NONE
	&& am->config->gprune_method != GPRUNE_SEL_USER) {
      jlog("  top N mixtures to calc = %d / %d  (-tmix)\n", am->config->mixnum_thres, am->hmminfo->maxcodebooksize);
    }
    if (am->config->hmm_gs_filename != NULL) {
      jlog("      GS state num thres = %d / %d selected  (-gsnum)\n", am->config->gs_statenum, am->hmm_gs->totalstatenum);
    }
    jlog("    short pause HMM name = \"%s\" specified", am->config->spmodel_name);
    if (am->hmminfo->sp != NULL) {
      jlog(", \"%s\" applied", am->hmminfo->sp->name);
      if (am->hmminfo->sp->is_pseudo) {
	jlog(" (pseudo)");
      } else {
	jlog(" (physical)");
      }
    } else {
      jlog(" but not assigned");
    }
    jlog("  (-sp)\n");
    jlog("  cross-word CD on pass1 = ");
#ifdef PASS1_IWCD
    jlog("handle by approx. ");
    switch(am->hmminfo->cdset_method) {
    case IWCD_AVG:
      jlog("(use average prob. of same LC)\n");
      break;
    case IWCD_MAX:
      jlog("(use max. prob. of same LC)\n");
      break;
    case IWCD_NBEST:
      jlog("(use %d-best of same LC)\n", am->hmminfo->cdmax_num);
      break;
    }
#else
    jlog("disabled\n");
#endif
    
    if (am->hmminfo->multipath) {
      jlog("   sp transition penalty = %+2.1f\n", am->config->iwsp_penalty);
    }

    jlog("\n");
  }

  jlog("------------------------------------------------------------\n");
  jlog("Language Model(s)\n");

  for(lm = recog->lmlist; lm; lm = lm->next) {
    jlog("\n");
    if (lm->config->name[0] != '\0') {
      jlog("[LM%02d \"%s\"]", lm->config->id, lm->config->name);
    } else {
      jlog("[LM%02d]", lm->config->id);
    }
    if (lm->lmtype == LM_PROB) {
      if (lm->lmvar == LM_NGRAM) {
	jlog(" type=n-gram\n\n");
	if (lm->ngram) {
	  print_ngram_info(fp, lm->ngram); jlog("\n");
	}
      } else if (lm->lmvar == LM_NGRAM_USER) {
	if (lm->ngram) {
	  jlog(" type=n-gram + user\n\n");
	  print_ngram_info(fp, lm->ngram); jlog("\n");
	} else {
	  jlog(" type=user\n\n");
	}
      } else {
	jlog(" type=UNKNOWN??\n\n");
      }
    } else if (lm->lmtype == LM_DFA) {
      if (lm->lmvar == LM_DFA_GRAMMAR) {
	jlog(" type=grammar\n\n");
	if (lm->dfa) {
	  print_dfa_info(fp, lm->dfa); jlog("\n");
	  if (debug2_flag) {
	    print_dfa_cp(fp, lm->dfa);
	    jlog("\n");
	  }
	}
      } else if (lm->lmvar == LM_DFA_WORD) {
	jlog(" type=word\n\n");
      } else {
	jlog(" type=UNKNOWN??\n\n");
      }
    } else {
      jlog(" type=UNKNOWN??\n\n");
    }
    if (lm->winfo != NULL) {
      print_voca_info(fp, lm->winfo); jlog("\n");
    }

    jlog(" Parameters:\n");

    if (lm->lmtype == LM_DFA && lm->lmvar == LM_DFA_GRAMMAR) {
      if (lm->dfa != NULL) {
	int i;
	jlog("   found sp category IDs =");
	for(i=0;i<lm->dfa->term_num;i++) {
	  if (lm->dfa->is_sp[i]) {
	    jlog(" %d", i);
	  }
	}
	jlog("\n");
      }
    }
    
    if (lm->lmtype == LM_PROB) {
      if (lm->config->enable_iwspword) {
	jlog("\tIW-sp word added to dict= \"%s\"\n", lm->config->iwspentry);
      }
      if (lm->config->additional_dict_files) {
	JCONF_LM_NAMELIST *nl;
	jlog("\tadditional dictionaries:\n");
	for(nl=lm->config->additional_dict_files;nl;nl=nl->next) {
	  jlog("\t\t\t%s\n", nl->name);
	}
	jlog("\n");
      }
      if (lm->config->additional_dict_entries) {
	JCONF_LM_NAMELIST *nl;
	int n = 0;
	jlog("\tadditional dict entries:\n");
	for(nl=lm->config->additional_dict_entries;nl;nl=nl->next) {
	  jlog("\t\t\t%s\n", nl->name);
	  n++;
	}
	jlog("--- total %d entries\n", n);
      }
    }

    if (lm->lmtype == LM_PROB) {    
      jlog("\t(-silhead)head sil word = ");
      put_voca(fp, lm->winfo, lm->winfo->head_silwid);
      jlog("\t(-siltail)tail sil word = ");
      put_voca(fp, lm->winfo, lm->winfo->tail_silwid);
    }

    if (lm->lmvar == LM_DFA_WORD) {
      jlog("     silence model names to add at word head / tail:  (-wsil)\n");
      jlog("\tword head          = \"%s\"\n", lm->config->wordrecog_head_silence_model_name);
      jlog("\tword tail          = \"%s\"\n", lm->config->wordrecog_tail_silence_model_name);
      jlog("\ttheir context name = \"%s\"\n", (lm->config->wordrecog_silence_context_name[0] == '\0') ? "NULL (blank)" : lm->config->wordrecog_silence_context_name);
      
    }

  }

  jlog("\n");
  jlog("------------------------------------------------------------\n");
  jlog("Recognizer(s)\n\n");

  for(r = recog->process_list; r; r = r->next) {
    jlog("[SR%02d", r->config->id);
    if (r->config->name[0] != '\0') {
      jlog(" \"%s\"", r->config->name);
    }
    jlog("]  ");
    if (r->am->config->name[0] != '\0') {
      jlog("AM%02d \"%s\"", r->am->config->id, r->am->config->name);
    } else {
      jlog("AM%02d", r->am->config->id);
    }
    jlog("  +  ");
    if (r->lm->config->name[0] != '\0') {
      jlog("LM%02d \"%s\"", r->lm->config->id, r->lm->config->name);
    } else {
      jlog("LM%02d", r->lm->config->id);
    }
    jlog("\n\n");

    if (r->wchmm != NULL) {
      print_wchmm_info(r->wchmm); jlog("\n");
    }
    if (r->lmtype == LM_PROB) {
      jlog(" Inter-word N-gram cache: \n");
      {
	int num, len;
#ifdef UNIGRAM_FACTORING
	len = r->wchmm->isolatenum;
	jlog("\troot node to be cached = %d / %d (isolated only)\n",
	     len, r->wchmm->startnum);
#else
	len = r->wchmm->startnum;
	jlog("\troot node to be cached = %d (all)\n", len);
#endif
#ifdef HASH_CACHE_IW
	num = (r->config->pass1.iw_cache_rate * r->lm->ngram->max_word_num) / 100;
	jlog("\tword ends to be cached = %d / %d\n", num, r->lm->ngram->max_word_num);
#else
	num = r->lm->ngram->max_word_num;
	jlog("\tword ends to be cached = %d (all)\n", num);
#endif
	jlog("\t  max. allocation size = %dMB\n", num * len / 1000 * sizeof(LOGPROB) / 1000);
      }
    }

    if (r->lmtype == LM_PROB) {
      jlog("\t(-lmp)  pass1 LM weight = %2.1f  ins. penalty = %+2.1f\n", r->config->lmp.lm_weight, r->config->lmp.lm_penalty);
      jlog("\t(-lmp2) pass2 LM weight = %2.1f  ins. penalty = %+2.1f\n", r->config->lmp.lm_weight2, r->config->lmp.lm_penalty2);
      jlog("\t(-transp)trans. penalty = %+2.1f per word\n", r->config->lmp.lm_penalty_trans);
    } else if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) {
      jlog("\t(-penalty1) IW penalty1 = %+2.1f\n", r->config->lmp.penalty1);
      jlog("\t(-penalty2) IW penalty2 = %+2.1f\n", r->config->lmp.penalty2);
    }


#ifdef CONFIDENCE_MEASURE
#ifdef CM_MULTIPLE_ALPHA
    jlog("\t(-cmalpha)CM alpha coef = from %f to %f by step of %f (%d outputs)\n", r->config->annotate.cm_alpha_bgn, r->config->annotate.cm_alpha_end, r->config->annotate.cm_alpha_step, r->config->annotate.cm_alpha_num);
#else
    jlog("\t(-cmalpha)CM alpha coef = %f\n", r->config->annotate.cm_alpha);
#endif
#ifdef CM_SEARCH_LIMIT
    jlog("\t(-cmthres) CM cut thres = %f for hypo generation\n", r->config->annotate.cm_cut_thres);
#endif
#ifdef CM_SEARCH_LIMIT_POP
    jlog("\t(-cmthres2)CM cut thres = %f for popped hypo\n", r->config->annotate.cm_cut_thres_pop);
#endif
#endif /* CONFIDENCE_MEASURE */
    jlog("\n");

    if (r->am->hmminfo->multipath) {
      if (r->lm->config->enable_iwsp) {
	jlog("\t inter-word short pause = on (append \"%s\" for each word tail)\n", r->am->hmminfo->sp->name);
	jlog("\t  sp transition penalty = %+2.1f\n", r->am->config->iwsp_penalty);
      }
    }

    if (r->lmvar == LM_DFA_WORD) {
#ifdef DETERMINE
      jlog("    early word determination:  (-wed)\n");
      jlog("\tscore threshold    = %f\n", r->config->pass1.determine_score_thres);
      jlog("\tframe dur. thres   = %d\n", r->config->pass1.determine_duration_thres);
#endif
    }

    jlog(" Search parameters: \n");
    jlog("\t    multi-path handling = ");
    if (r->am->hmminfo->multipath) {
      jlog("yes, multi-path mode enabled\n");
    } else {
      jlog("no\n");
    }
    jlog("\t(-b) trellis beam width = %d", r->trellis_beam_width);
    if (r->config->pass1.specified_trellis_beam_width == -1) {
      jlog(" (-1 or not specified - guessed)\n");
    } else if (r->config->pass1.specified_trellis_beam_width == 0) {
      jlog(" (0 - full)\n");
    } else {
      jlog("\n");
    }
#ifdef SCORE_PRUNING
    if (r->config->pass1.score_pruning_width < 0.0) {
      jlog("\t(-bs)score pruning thres= disabled\n");
    } else {
      jlog("\t(-bs)score pruning thres= %f\n", r->config->pass1.score_pruning_width);
    }
#endif
    jlog("\t(-n)search candidate num= %d\n", r->config->pass2.nbest);
    jlog("\t(-s)  search stack size = %d\n", r->config->pass2.stack_size);
    jlog("\t(-m)    search overflow = after %d hypothesis poped\n", r->config->pass2.hypo_overflow);
    jlog("\t        2nd pass method = ");
    if (r->config->graph.enabled) {
#ifdef GRAPHOUT_DYNAMIC
#ifdef GRAPHOUT_SEARCH
      jlog("searching graph, generating dynamic graph\n");
#else
      jlog("searching sentence, generating dynamic graph\n");
#endif /* GRAPHOUT_SEARCH */
#else  /* ~GRAPHOUT_DYNAMIC */
      jlog("searching sentence, generating static graph from N-best\n");
#endif
    } else {
      jlog("searching sentence, generating N-best\n");
    }
    if (r->config->pass2.enveloped_bestfirst_width >= 0) {
      jlog("\t(-b2)  pass2 beam width = %d\n", r->config->pass2.enveloped_bestfirst_width);
    }
    jlog("\t(-lookuprange)lookup range= %d  (tm-%d <= t <tm+%d)\n",r->config->pass2.lookup_range,r->config->pass2.lookup_range,r->config->pass2.lookup_range);
#ifdef SCAN_BEAM
    jlog("\t(-sb)2nd scan beamthres = %.1f (in logscore)\n", r->config->pass2.scan_beam_thres);
#endif
    jlog("\t(-n)        search till = %d candidates found\n", r->config->pass2.nbest);
    jlog("\t(-output)    and output = %d candidates out of above\n", r->config->output.output_hypo_maxnum);

    if (r->ccd_flag) {
      jlog("\t IWCD handling:\n");
#ifdef PASS1_IWCD
      jlog("\t   1st pass: approximation ");
      switch(r->am->hmminfo->cdset_method) {
      case IWCD_AVG:
	jlog("(use average prob. of same LC)\n");
	break;
      case IWCD_MAX:
	jlog("(use max. prob. of same LC)\n");
	break;
      case IWCD_NBEST:
	jlog("(use %d-best of same LC)\n", r->am->hmminfo->cdmax_num);
	break;
      }
#else
      jlog("\t   1st pass: ignored\n");
#endif
#ifdef PASS2_STRICT_IWCD
      jlog("\t   2nd pass: strict (apply when expanding hypo. )\n");
#else
      jlog("\t   2nd pass: loose (apply when hypo. is popped and scanned)\n");
#endif
    }
    if (r->lmtype == LM_PROB) {
      jlog("\t factoring score: ");
#ifdef UNIGRAM_FACTORING
      jlog("1-gram prob. (statically assigned beforehand)\n");
#else
      jlog("2-gram prob. (dynamically computed while search)\n");
#endif
    }

    if (r->config->annotate.align_result_word_flag) {
      jlog("\t output word alignments\n");
    }
    if (r->config->annotate.align_result_phoneme_flag) {
      jlog("\t output phoneme alignments\n");
    }
    if (r->config->annotate.align_result_state_flag) {
      jlog("\t output state alignments\n");
    }
    if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) {
      if (r->config->pass2.looktrellis_flag) {
	jlog("\t only words in backtrellis will be expanded in 2nd pass\n");
      } else {
	jlog("\t all possible words will be expanded in 2nd pass\n");
      }
    }
    if (r->wchmm != NULL) {
      if (r->wchmm->category_tree) {
	if (r->config->pass1.old_tree_function_flag) {
	  jlog("\t build_wchmm() used\n");
	} else {
	  jlog("\t build_wchmm2() used\n");
	}
#ifdef PASS1_IWCD
#ifdef USE_OLD_IWCD
	jlog("\t full lcdset used\n");
#else
	jlog("\t lcdset limited by word-pair constraint\n");
#endif
#endif /* PASS1_IWCD */
      }
    }
    if (r->config->output.progout_flag) {
      jlog("\tprogressive output on 1st pass\n");
    }
    if (r->config->compute_only_1pass) {
      jlog("\tCompute only 1-pass\n");
    }
    
    if (r->config->graph.enabled) {
      jlog("\n");
      jlog("Graph-based output with graph-oriented search:\n");
      jlog("\t(-lattice)      word lattice = %s\n", r->config->graph.lattice ? "yes" : "no");
      jlog("\t(-confnet) confusion network = %s\n", r->config->graph.confnet ? "yes" : "no");
      if (r->config->graph.lattice == TRUE) {
	jlog("\t(-graphrange)         margin = %d frames", r->config->graph.graph_merge_neighbor_range);
	if (r->config->graph.graph_merge_neighbor_range < 0) {
	  jlog(" (all post-marging disabled)\n");
	} else if (r->config->graph.graph_merge_neighbor_range == 0) {
	  jlog(" (merge same word with the same boundary)\n");
	} else {
	  jlog(" (merge same words around this margin)\n");
	}
      }
#ifdef GRAPHOUT_DEPTHCUT
      jlog("\t(-graphcut)cutoff depth      = ");
      if (r->config->graph.graphout_cut_depth < 0) {
	jlog("disabled (-1)\n");
      } else {
	jlog("%d words\n",r->config->graph.graphout_cut_depth);
      }
#endif
#ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP
      jlog("\t(-graphboundloop)loopmax     = %d for boundary adjustment\n",r->config->graph.graphout_limit_boundary_loop_num);
#endif
#ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION
      jlog("\tInhibit graph search termination before 1st sentence found = ");
      if (r->config->graph.graphout_search_delay) {
	jlog("enabled\n");
      } else {
	jlog("disabled\n");
      }
#endif

    }
    
    if (r->config->successive.enabled) {
      jlog("\tshort pause segmentation = on\n");
      jlog("\t      sp duration length = %d frames\n", r->config->successive.sp_frame_duration);
#ifdef SPSEGMENT_NAIST
      jlog("      backstep margin on trigger = %d frames\n", r->config->successive.sp_margin);
      jlog("\t        delay on trigger = %d frames\n", r->config->successive.sp_delay);
#endif
      if (r->config->successive.pausemodelname) {
	jlog("\t   pause models for seg. = %s\n",  r->config->successive.pausemodelname);
      }
    } else {
      jlog("\tshort pause segmentation = off\n");
    }
    if (r->config->output.progout_flag) {
      jlog("\t        progout interval = %d msec\n", r->config->output.progout_interval);
    }
    jlog("\tfall back on search fail = ");
    if (r->config->sw.fallback_pass1_flag) {
      jlog("on, adopt 1st pass result as final\n");
    } else {
      jlog("off, returns search failure\n");
    }

    jlog("\n");
  }

  jlog("------------------------------------------------------------\n");
  jlog("Decoding algorithm:\n\n");
  jlog("\t1st pass input processing = ");
  if (jconf->decodeopt.force_realtime_flag) jlog("(forced) ");
  if (jconf->decodeopt.realtime_flag) {
    jlog("real time, on-the-fly\n");
  } else {
    jlog("buffered, batch\n");
  }
  jlog("\t1st pass method = ");
#ifdef WPAIR
# ifdef WPAIR_KEEP_NLIMIT
  jlog("word-pair approx., keeping only N tokens ");
# else
  jlog("word-pair approx. ");
# endif
#else
  jlog("1-best approx. ");
#endif
#ifdef WORD_GRAPH
  jlog("generating word_graph\n");
#else
  jlog("generating indexed trellis\n");
#endif
#ifdef CONFIDENCE_MEASURE
  jlog("\toutput word confidence measure ");
#ifdef CM_NBEST
  jlog("based on N-best candidates\n");
#endif
#ifdef CM_SEARCH
  jlog("based on search-time scores\n");
#endif
#endif /* CONFIDENCE_MEASURE */
  
  jlog("\n");

  jlog("------------------------------------------------------------\n");
  jlog("FrontEnd:\n\n");

  jlog(" Input stream:\n");
  jlog("\t             input type = ");
  switch(jconf->input.type) {
  case INPUT_WAVEFORM:
    jlog("waveform\n");
    break;
  case INPUT_VECTOR:
    jlog("feature vector sequence\n");
    break;
  }
  jlog("\t           input source = ");
  if (jconf->input.plugin_source != -1) {
    jlog("plugin\n");
  } else if (jconf->input.speech_input == SP_RAWFILE) {
    jlog("waveform file\n");
    jlog("\t          input filelist = ");
    if (jconf->input.inputlist_filename == NULL) {
      jlog("(none, get file name from stdin)\n");
    } else {
      jlog("%s\n", jconf->input.inputlist_filename);
    }
  } else if (jconf->input.speech_input == SP_MFCFILE) {
    jlog("feature vector file (HTK format)\n");
    jlog("\t                filelist = ");
    if (jconf->input.inputlist_filename == NULL) {
      jlog("(none, get file name from stdin)\n");
    } else {
      jlog("%s\n", jconf->input.inputlist_filename);
    }
  } else if (jconf->input.speech_input == SP_STDIN) {
    jlog("standard input\n");
  } else if (jconf->input.speech_input == SP_ADINNET) {
    jlog("adinnet client\n");
#ifdef USE_NETAUDIO
  } else if (jconf->input.speech_input == SP_NETAUDIO) {
    char *p;
    jlog("NetAudio server on ");
    if (jconf->input.netaudio_devname != NULL) {
      jlog("%s\n", jconf->input.netaudio_devname);
    } else if ((p = getenv("AUDIO_DEVICE")) != NULL) {
      jlog("%s\n", p);
    } else {
      jlog("local port\n");
    }
#endif
  } else if (jconf->input.speech_input == SP_MIC) {
    jlog("microphone\n");
    jlog("\t    device API          = ");
    switch(jconf->input.device) {
    case SP_INPUT_DEFAULT: jlog("default\n"); break;
    case SP_INPUT_ALSA: jlog("alsa\n"); break;
    case SP_INPUT_OSS: jlog("oss\n"); break;
    case SP_INPUT_ESD: jlog("esd\n"); break;
    case SP_INPUT_PULSEAUDIO: jlog("pulseaudio\n"); break;
    }
  }
  if (jconf->input.type == INPUT_WAVEFORM) {
    if (jconf->input.speech_input == SP_RAWFILE || jconf->input.speech_input == SP_STDIN || jconf->input.speech_input == SP_ADINNET) {
      if (jconf->input.use_ds48to16) {
	jlog("\t          sampling freq. = assume 48000Hz, then down to %dHz\n", jconf->input.sfreq);
      } else {
	jlog("\t          sampling freq. = %d Hz required\n", jconf->input.sfreq);
      }
    } else {
      if (jconf->input.use_ds48to16) {
	jlog("\t          sampling freq. = 48000Hz, then down to %d Hz\n", jconf->input.sfreq);
      } else {
 	jlog("\t          sampling freq. = %d Hz\n", jconf->input.sfreq);
      }
    }
  }
  if (jconf->input.type == INPUT_WAVEFORM) {
    jlog("\t         threaded A/D-in = ");
#ifdef HAVE_PTHREAD
    if (recog->adin->enable_thread) {
      jlog("supported, on\n");
    } else {
      jlog("supported, off\n");
    }
#else
    jlog("not supported (live input may be dropped)\n");
#endif
  }
  if (jconf->preprocess.strip_zero_sample) {
    jlog("\t   zero frames stripping = on\n");
  } else {
    jlog("\t   zero frames stripping = off\n");
  }
  if (jconf->input.type == INPUT_WAVEFORM) {
    if (recog->adin->adin_cut_on) {
      jlog("\t         silence cutting = on\n");
      jlog("\t             level thres = %d / 32767\n", jconf->detect.level_thres);
      jlog("\t         zerocross thres = %d / sec.\n", jconf->detect.zero_cross_num);
      jlog("\t             head margin = %d msec.\n", jconf->detect.head_margin_msec);
      jlog("\t             tail margin = %d msec.\n", jconf->detect.tail_margin_msec);
      jlog("\t              chunk size = %d samples\n", jconf->detect.chunk_size);
    } else {
      jlog("\t         silence cutting = off\n");
    }

    if (jconf->preprocess.use_zmean) {
      jlog("\t    long-term DC removal = on");
      if (jconf->input.speech_input == SP_RAWFILE) {
	jlog(" (will compute for each file)\n");
      } else {
	jlog(" (will compute from first %.1f sec)\n", (float)ZMEANSAMPLES / (float)jconf->input.sfreq);
      }
    } else {
      jlog("\t    long-term DC removal = off\n");
    }
  }
  jlog("\t      reject short input = ");
  if (jconf->reject.rejectshortlen > 0) {
    jlog("< %d msec\n", jconf->reject.rejectshortlen);
  } else {
    jlog("off\n");
  }
#ifdef POWER_REJECT
  jlog("\t   power rejection thres = %f", jconf->reject.powerthres);
#endif

  jlog("\n");

  jlog("----------------------- System Information end -----------------------\n");

#ifdef USE_MIC
  if (jconf->decodeopt.realtime_flag) {
    boolean flag;
    flag = FALSE;
    for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
      if (mfcc->para->cmn && mfcc->cmn.loaded) {
	flag = TRUE;
	break;
      }
    }
    if (flag) {
      jlog("\n");
      jlog("initial CMN parameter loaded from file\nfor");
      for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
	if (mfcc->para->cmn && mfcc->cmn.loaded) {
	  jlog(" MFCC%02d", mfcc->id);
	}
      }
      jlog("\n");
    }
    flag = FALSE;
    for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
      if (mfcc->para->cmn && !mfcc->cmn.loaded) {
	flag = TRUE;
	break;
      }
    }
    if (flag) {
      jlog("\n");
      jlog("\t*************************************************************\n");
      jlog("\t* NOTICE: The first input may not be recognized, since      *\n");
      jlog("\t*         no initial CMN parameter is available on startup. *\n");
      jlog("\t* for");
      for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
	if (mfcc->para->cmn && !mfcc->cmn.loaded) {
	  jlog(" MFCC%02d", mfcc->id);
	}
      }
      jlog("*\n");
      jlog("\t*************************************************************\n");
    }
    flag = FALSE;
    for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
      if (mfcc->para->energy && mfcc->para->enormal) {
	flag = TRUE;
	break;
      }
    }
    if (flag) {
      jlog("\t*************************************************************\n");
      jlog("\t* NOTICE: Energy normalization is activated on live input:  *\n");
      jlog("\t*         maximum energy of LAST INPUT will be used for it. *\n");
      jlog("\t*         So, the first input will not be recognized.       *\n");
      jlog("\t* for");
      for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) {
	if (mfcc->para->energy && mfcc->para->enormal) {
	  jlog(" MFCC%02d", mfcc->id);
	}
      }
      jlog("*\n");
      jlog("\t*************************************************************\n");
    }
  }
#endif
}
Exemplo n.º 2
0
/** 
 * <JA>
 * ヘルプを表示する. 
 * 
 * </JA>
 * <EN>
 * Output help document.
 * 
 * </EN>
 *
 * @param fp [in] file pointer to output help
 *
 * @callgraph
 * @callergraph
 * @ingroup engine
 * 
 */
void
j_output_argument_help(FILE *fp)
{
  Jconf *jconf;
#ifdef ENABLE_PLUGIN
  int id;
  char buf[64];
  PLUGIN_ENTRY *p;
  FUNC_VOID func;
#endif
    
  /* load default values */
  jconf = j_jconf_new();

  j_put_header(fp);
  j_put_compile_defs(fp);
  fprintf(fp, "\nOptions:\n");

  fprintf(fp, "\n--- Global Options -----------------------------------------------\n");

  fprintf(fp, "\n Speech Input:\n");
  fprintf(fp, "    (Can extract only MFCC based features from waveform)\n");
  fprintf(fp, "    [-input devname]    input source  (default = htkparam)\n");
  fprintf(fp, "         htkparam/mfcfile  HTK parameter file\n");
  fprintf(fp, "         file/rawfile      waveform file (%s)\n", SUPPORTED_WAVEFILE_FORMAT);
#ifdef USE_MIC
  fprintf(fp, "         mic               default microphone device\n");
# ifdef HAS_ALSA
  fprintf(fp, "         alsa              use ALSA interface\n");
# endif
# ifdef HAS_OSS
  fprintf(fp, "         oss               use OSS interface\n");
# endif
# ifdef HAS_ESD
  fprintf(fp, "         esd               use ESounD interface\n");
# endif
#endif
#ifdef USE_NETAUDIO
  fprintf(fp, "         netaudio          DatLink/NetAudio server\n");
#endif
  fprintf(fp, "         adinnet           adinnet client (TCP/IP)\n");
  fprintf(fp, "         stdin             standard input\n");
#ifdef ENABLE_PLUGIN
  if (global_plugin_list) {
    if ((id = plugin_get_id("adin_get_optname")) >= 0) {
      for(p=global_plugin_list[id];p;p=p->next) {
	func = (FUNC_VOID) p->func;
	(*func)(buf, (int)64);
	fprintf(fp, "         %-18s(adin plugin #%d)\n", buf, p->source_id);
      }
    }
    if ((id = plugin_get_id("fvin_get_optname")) >= 0) {
      for(p=global_plugin_list[id];p;p=p->next) {
	func = (FUNC_VOID) p->func;
	(*func)(buf, (int)64);
	fprintf(fp, "         %-18s(feature vector input plugin #%d)\n", buf, p->source_id);
      }
    }
  }
#endif
  fprintf(fp, "    [-filelist file]    filename of input file list\n");
#ifdef USE_NETAUDIO
  fprintf(fp, "    [-NA host:unit]     get audio from NetAudio server at host:unit\n");
#endif
  fprintf(fp, "    [-adport portnum]   adinnet port number to listen         (%d)\n", jconf->input.adinnet_port);
  fprintf(fp, "    [-48]               enable 48kHz sampling with internal down sampler (OFF)\n");
  fprintf(fp, "    [-zmean/-nozmean]   enable/disable DC offset removal      (OFF)\n");
  fprintf(fp, "    [-nostrip]          disable stripping off zero samples\n");
  fprintf(fp, "    [-record dir]       record triggered speech data to dir\n");
  fprintf(fp, "    [-rejectshort msec] reject an input shorter than specified\n");
#ifdef POWER_REJECT
  fprintf(fp, "    [-powerthres value] rejection threshold of average power  (%.1f)\n", jconf->reject.powerthres);
#endif
  
  fprintf(fp, "\n Speech Detection: (default: on=mic/net off=files)\n");
  /*fprintf(fp, "    [-pausesegment]     turn on (force) pause detection\n");*/
  /*fprintf(fp, "    [-nopausesegment]   turn off (force) pause detection\n");*/
  fprintf(fp, "    [-cutsilence]       turn on (force) skipping long silence\n");
  fprintf(fp, "    [-nocutsilence]     turn off (force) skipping long silence\n");
  fprintf(fp, "    [-lv unsignedshort] input level threshold (0-32767)       (%d)\n", jconf->detect.level_thres);
  fprintf(fp, "    [-zc zerocrossnum]  zerocross num threshold per sec.      (%d)\n", jconf->detect.zero_cross_num);
  fprintf(fp, "    [-headmargin msec]  header margin length in msec.         (%d)\n", jconf->detect.head_margin_msec);
  fprintf(fp, "    [-tailmargin msec]  tail margin length in msec.           (%d)\n", jconf->detect.tail_margin_msec);

  fprintf(fp, "\n GMM utterance verification:\n");
  fprintf(fp, "    -gmm filename       GMM definition file\n");
  fprintf(fp, "    -gmmnum num         GMM Gaussian pruning num              (%d)\n", jconf->reject.gmm_gprune_num);
  fprintf(fp, "    -gmmreject string   comma-separated list of noise model name to reject\n");
#ifdef GMM_VAD
  fprintf(fp, "\n GMM-based VAD:\n");
  fprintf(fp, "    -gmmmargin frames   backstep margin on speech trigger     (%d)\n", jconf->detect.gmm_margin);
  fprintf(fp, "    -gmmup score        up-trigger threshold                  (%.1f)\n", jconf->detect.gmm_uptrigger_thres);
  fprintf(fp, "    -gmmdown score      down-trigger threshold                (%.1f)\n", jconf->detect.gmm_downtrigger_thres);
#endif

  fprintf(fp, "\n On-the-fly Decoding: (default: on=mic/net off=files)\n");
  fprintf(fp, "    [-realtime]         turn on, input streamed with MAP-CMN\n");
  fprintf(fp, "    [-norealtime]       turn off, input buffered with sentence CMN\n");

  fprintf(fp, "\n Others:\n");
  fprintf(fp, "    [-C jconffile]      load options from jconf file\n");
  fprintf(fp, "    [-quiet]            reduce output to only word string\n");
  fprintf(fp, "    [-demo]             equal to \"-quiet -progout\"\n");
  fprintf(fp, "    [-debug]            (for debug) dump numerous log\n");
  fprintf(fp, "    [-callbackdebug]    (for debug) output message per callback\n");
  fprintf(fp, "    [-check (wchmm|trellis)] (for debug) check internal structure\n");
  fprintf(fp, "    [-check triphone]   triphone mapping check\n");
  fprintf(fp, "    [-setting]          print engine configuration and exit\n");
  fprintf(fp, "    [-help]             print this message and exit\n");

  fprintf(fp, "\n--- Instance Declarations ----------------------------------------\n\n");

  fprintf(fp, "    [-AM]               start a new acoustic model instance\n");
  fprintf(fp, "    [-LM]               start a new language model instance\n");
  fprintf(fp, "    [-SR]               start a new recognizer (search) instance\n");
  fprintf(fp, "    [-AM_GMM]           start an AM feature instance for GMM\n");
  fprintf(fp, "    [-GLOBAL]           start a global section\n");
  fprintf(fp, "    [-nosectioncheck]   disable option location check\n");
  fprintf(fp, "\n--- Acoustic Model Options (-AM) ---------------------------------\n");

  fprintf(fp, "\n Acoustic analysis:\n");
  fprintf(fp, "    [-htkconf file]     load parameters from the HTK Config file\n");
  fprintf(fp, "    [-smpFreq freq]     sample period (Hz)                    (%ld)\n", jconf->am_root->analysis.para_default.smp_freq);
  fprintf(fp, "    [-smpPeriod period] sample period (100ns)                 (%ld)\n", jconf->am_root->analysis.para_default.smp_period);
  fprintf(fp, "    [-fsize sample]     window size (sample)                  (%d)\n", jconf->am_root->analysis.para_default.framesize);
  fprintf(fp, "    [-fshift sample]    frame shift (sample)                  (%d)\n", jconf->am_root->analysis.para_default.frameshift);
  fprintf(fp, "    [-preemph]          pre-emphasis coef.                    (%.2f)\n", jconf->am_root->analysis.para_default.preEmph);
  fprintf(fp, "    [-fbank]            number of filterbank channels         (%d)\n", jconf->am_root->analysis.para_default.fbank_num);
  fprintf(fp, "    [-ceplif]           cepstral liftering coef.              (%d)\n", jconf->am_root->analysis.para_default.lifter);
  fprintf(fp, "    [-rawe] [-norawe]   toggle using raw energy               (no)\n");
  fprintf(fp, "    [-enormal] [-noenormal] toggle normalizing log energy     (no)\n");
  fprintf(fp, "    [-escale]           scaling log energy for enormal        (%.1f)\n", jconf->am_root->analysis.para_default.escale);
  fprintf(fp, "    [-silfloor]         energy silence floor in dB            (%.1f)\n", jconf->am_root->analysis.para_default.silFloor);
  fprintf(fp, "    [-delwin frame]     delta windows length (frame)          (%d)\n", jconf->am_root->analysis.para_default.delWin);
  fprintf(fp, "    [-accwin frame]     accel windows length (frame)          (%d)\n", jconf->am_root->analysis.para_default.accWin);
  fprintf(fp, "    [-hifreq freq]      freq. of upper band limit, off if <0  (%d)\n", jconf->am_root->analysis.para_default.hipass);
  fprintf(fp, "    [-lofreq freq]      freq. of lower band limit, off if <0  (%d)\n", jconf->am_root->analysis.para_default.lopass);
  fprintf(fp, "    [-sscalc]           do spectral subtraction (file input only)\n");
  fprintf(fp, "    [-sscalclen msec]   length of head silence for SS (msec)  (%d)\n", jconf->am_root->frontend.sscalc_len);
  fprintf(fp, "    [-ssload filename]  load constant noise spectrum from file for SS\n");
  fprintf(fp, "    [-ssalpha value]    alpha coef. for SS                    (%f)\n", jconf->am_root->frontend.ss_alpha);
  fprintf(fp, "    [-ssfloor value]    spectral floor for SS                 (%f)\n", jconf->am_root->frontend.ss_floor);
  fprintf(fp, "    [-zmeanframe/-nozmeanframe] frame-wise DC removal like HTK(OFF)\n");
  fprintf(fp, "    [-usepower/-nousepower] use power in fbank analysis       (OFF)\n");
  fprintf(fp, "    [-cmnload file]     load initial CMN param from file on startup\n");
  fprintf(fp, "    [-cmnsave file]     save CMN param to file after each input\n");
  fprintf(fp, "    [-cmnnoupdate]      not update CMN param while recog. (use with -cmnload)\n");
  fprintf(fp, "    [-cmnmapweight]     weight value of initial cm for MAP-CMN (%6.2f)\n", jconf->am_root->analysis.cmn_map_weight);
  fprintf(fp, "    [-cvn]              cepstral variance normalisation       (%s)\n", jconf->amnow->analysis.para.cvn ? "on" : "off");
  fprintf(fp, "    [-vtln alpha lowcut hicut] enable VTLN (1.0 to disable)   (%f)\n", jconf->am_root->analysis.para_default.vtln_alpha);

  fprintf(fp, "\n Acoustic Model:\n");
  fprintf(fp, "    -h hmmdefsfile      HMM definition file name\n");
  fprintf(fp, "    [-hlist HMMlistfile] HMMlist filename (must for triphone model)\n");
  fprintf(fp, "    [-iwcd1 methodname] switch IWCD triphone handling on 1st pass\n");
  fprintf(fp, "             best N     use N best score (default of n-gram, N=%d)\n", jconf->am_root->iwcdmaxn);
  fprintf(fp, "             max        use maximum score\n");
  fprintf(fp, "             avg        use average score (default of dfa)\n");
  fprintf(fp, "    [-force_ccd]        force to handle IWCD\n");
  fprintf(fp, "    [-no_ccd]           don't handle IWCD\n");
  fprintf(fp, "    [-notypecheck]      don't check input parameter type\n");
  fprintf(fp, "    [-spmodel HMMname]  name of short pause model             (\"%s\")\n", SPMODEL_NAME_DEFAULT);
  fprintf(fp, "    [-multipath]        switch decoding for multi-path HMM    (auto)\n");

  fprintf(fp, "\n Acoustic Model Computation Method:\n");
  fprintf(fp, "    [-gprune methodname] select Gaussian pruning method:\n");
#ifdef GPRUNE_DEFAULT_SAFE
  fprintf(fp, "             safe          safe pruning (default for TM/PTM)\n");
#else
  fprintf(fp, "             safe          safe pruning\n");
#endif
#if GPRUNE_DEFAULT_HEURISTIC
  fprintf(fp, "             heuristic     heuristic pruning (default for TM/PTM)\n");
#else
  fprintf(fp, "             heuristic     heuristic pruning\n");
#endif
#if GPRUNE_DEFAULT_BEAM
  fprintf(fp, "             beam          beam pruning (default for TM/PTM)\n");
#else
  fprintf(fp, "             beam          beam pruning\n");
#endif
  fprintf(fp, "             none          no pruning (default for non tmix models)\n");
#ifdef ENABLE_PLUGIN
  if (global_plugin_list) {
    if ((id = plugin_get_id("calcmix_get_optname")) >= 0) {
      for(p=global_plugin_list[id];p;p=p->next) {
	func = (FUNC_VOID) p->func;
	(*func)(buf, (int)64);
	fprintf(fp, "             %-14s(calculation plugin #%d)\n", buf, p->source_id);
      }
    }
  }
#endif
  fprintf(fp, "    [-tmix gaussnum]    Gaussian num threshold per mixture for pruning (%d)\n", jconf->am_root->mixnum_thres);
  fprintf(fp, "    [-gshmm hmmdefs]    monophone hmmdefs for GS\n");
  fprintf(fp, "    [-gsnum N]          N-best state will be selected        (%d)\n", jconf->am_root->gs_statenum);

  fprintf(fp, "\n--- Language Model Options (-LM) ---------------------------------\n");

  fprintf(fp, "\n N-gram:\n");
  fprintf(fp, "    -d file.bingram     n-gram file in Julius binary format\n");
  fprintf(fp, "    -nlr file.arpa      forward n-gram file in ARPA format\n");
  fprintf(fp, "    -nrl file.arpa      backward n-gram file in ARPA format\n");
  fprintf(fp, "    [-lmp float float]  weight and penalty (tri: %.1f %.1f mono: %.1f %1.f)\n", DEFAULT_LM_WEIGHT_TRI_PASS1, DEFAULT_LM_PENALTY_TRI_PASS1, DEFAULT_LM_WEIGHT_MONO_PASS1, DEFAULT_LM_PENALTY_MONO_PASS1);
  fprintf(fp, "    [-lmp2 float float]       for 2nd pass (tri: %.1f %.1f mono: %.1f %1.f)\n", DEFAULT_LM_WEIGHT_TRI_PASS2, DEFAULT_LM_PENALTY_TRI_PASS2, DEFAULT_LM_WEIGHT_MONO_PASS2, DEFAULT_LM_PENALTY_MONO_PASS2);
  fprintf(fp, "    [-transp float]     penalty for transparent word (%+2.1f)\n", jconf->search_root->lmp.lm_penalty_trans);

  fprintf(fp, "\n DFA Grammar:\n");
  fprintf(fp, "    -dfa file.dfa       DFA grammar file\n");
  fprintf(fp, "    -gram file[,file2...] (list of) grammar prefix(es)\n");
  fprintf(fp, "    -gramlist filename  filename of grammar list\n");
  fprintf(fp, "    [-penalty1 float]   word insertion penalty (1st pass)     (%.1f)\n", jconf->search_root->lmp.penalty1);
  fprintf(fp, "    [-penalty2 float]   word insertion penalty (2nd pass)     (%.1f)\n", jconf->search_root->lmp.penalty2);

  fprintf(fp, "\n Word Dictionary for N-gram and DFA:\n");
  fprintf(fp, "    -v dictfile         dictionary file name\n");
  fprintf(fp, "    [-silhead wordname] (n-gram) beginning-of-sentence word   (%s)\n", BEGIN_WORD_DEFAULT);
  fprintf(fp, "    [-siltail wordname] (n-gram) end-of-sentence word         (%s)\n", END_WORD_DEFAULT);
  fprintf(fp, "    [-mapunk wordname]  (n-gram) map unknown words to this    (%s)\n", UNK_WORD_DEFAULT);
  fprintf(fp, "    [-forcedict]        ignore error entry and keep running\n");
  fprintf(fp, "    [-iwspword]         (n-gram) add short-pause word for inter-word CD sp\n");
  fprintf(fp, "    [-iwspentry entry]  (n-gram) word entry for \"-iwspword\" (%s)\n", IWSPENTRY_DEFAULT);
  
  fprintf(fp, "\n Isolated Word Recognition:\n");
  fprintf(fp, "    -w file[,file2...]  (list of) wordlist file name(s)\n");
  fprintf(fp, "    -wlist filename     file that contains list of wordlists\n");
  fprintf(fp, "    -wsil head tail sp  name of silence/pause model\n");
  fprintf(fp, "                          head - BOS silence model name       (%s)\n", jconf->lm_root->wordrecog_head_silence_model_name);
  fprintf(fp, "                          tail - EOS silence model name       (%s)\n", jconf->lm_root->wordrecog_tail_silence_model_name);
  fprintf(fp, "                           sp  - their name as context or \"NULL\" (%s)\n", (jconf->lm_root->wordrecog_silence_context_name[0] == '\0') ? "NULL" : jconf->lm_root->wordrecog_silence_context_name);
#ifdef DETERMINE
  fprintf(fp, "    -wed float int      thresholds for early word determination\n");
  fprintf(fp, "                        float: score threshold    (%.1f)\n", jconf->search_root->pass1.determine_score_thres);
  fprintf(fp, "                        int: frame duration thres (%d)\n", jconf->search_root->pass1.determine_duration_thres);
#endif

  fprintf(fp, "\n--- Recognizer / Search Options (-SR) ----------------------------\n");


  fprintf(fp, "\n Search Parameters for the First Pass:\n");
  fprintf(fp, "    [-b beamwidth]      beam width (by state num)             (guessed)\n");
  fprintf(fp, "                        (0: full search, -1: force guess)\n");
#ifdef WPAIR
# ifdef WPAIR_KEEP_NLIMIT
  fprintf(fp, "    [-nlimit N]         keeps only N tokens on each state     (%d)\n", jconf->search_root->pass1.wpair_keep_nlimit);
# endif
#endif
#ifdef SEPARATE_BY_UNIGRAM
  fprintf(fp, "    [-sepnum wordnum]   (n-gram) # of hi-freq word isolated from tree (%d)\n", jconf->lm_root->separate_wnum);
#endif
#ifdef HASH_CACHE_IW
  fprintf(fp, "    [-iwcache percent]  (n-gram) amount of inter-word LM cache (%3d)\n", jconf->search_root->pass1.iw_cache_rate);
#endif
  fprintf(fp, "    [-1pass]            do 1st pass only, omit 2nd pass\n");
  fprintf(fp, "    [-inactive]         recognition process not active on startup\n");

  fprintf(fp, "\n Search Parameters for the Second Pass:\n");
  fprintf(fp, "    [-b2 hyponum]       word envelope beam width (by hypo num) (%d)\n",jconf->search_root->pass2.enveloped_bestfirst_width);
  fprintf(fp, "    [-n N]              # of sentence to find                 (%d)\n", jconf->search_root->pass2.nbest);
  fprintf(fp, "    [-output N]         # of sentence to output               (%d)\n",jconf->search_root->output.output_hypo_maxnum);
#ifdef SCAN_BEAM
  fprintf(fp, "    [-sb score]         score beam threshold (by score)       (%.1f)\n", jconf->search_root->pass2.scan_beam_thres);
#endif
  fprintf(fp, "    [-s hyponum]        global stack size of hypotheses       (%d)\n", jconf->search_root->pass2.stack_size);
  fprintf(fp, "    [-m hyponum]        hypotheses overflow threshold num     (%d)\n", jconf->search_root->pass2.hypo_overflow);

  fprintf(fp, "    [-lookuprange N]    frame lookup range in word expansion  (%d)\n", jconf->search_root->pass2.lookup_range);
  fprintf(fp, "    [-looktrellis]      (dfa) expand only backtrellis words\n");
  fprintf(fp, "    [-[no]multigramout] (dfa) output per-grammar results\n");
  fprintf(fp, "    [-oldtree]          (dfa) use old build_wchmm()\n");
#ifdef PASS1_IWCD
  fprintf(fp, "    [-oldiwcd]          (dfa) use full lcdset\n");
#endif
  fprintf(fp, "    [-iwsp]             insert sp for all word end (multipath)(off)\n");
  fprintf(fp, "    [-iwsppenalty]      trans. penalty for iwsp (multipath)   (%.1f)\n", jconf->am_root->iwsp_penalty);

  fprintf(fp, "\n Short-pause Segmentation:\n");
  fprintf(fp, "    [-spsegment]        enable short-pause segmentation\n");
  fprintf(fp, "    [-spdur]            length threshold of sp frames         (%d)\n", jconf->search_root->successive.sp_frame_duration);
#ifdef SPSEGMENT_NAIST
  fprintf(fp, "    [-spmargin]         backstep margin on speech trigger     (%d)\n", jconf->search_root->successive.sp_margin);
  fprintf(fp, "    [-spdelay]          delay on speech trigger               (%d)\n", jconf->search_root->successive.sp_delay);
#endif
  fprintf(fp, "    [-pausemodels str]  comma-delimited list of pause models for segment\n");

  fprintf(fp, "\n Graph Output with graph-oriented search:\n");
  fprintf(fp, "    [-lattice]          enable word graph (lattice) output\n");
  fprintf(fp, "    [-confnet]          enable confusion network output\n");
  fprintf(fp, "    [-nolattice]][-noconfnet] disable lattice / confnet output\n");
  fprintf(fp, "    [-graphrange N]     merge same words in graph (%d)\n", jconf->search_root->graph.graph_merge_neighbor_range);
  fprintf(fp, "                        -1: not merge, leave same loc. with diff. score\n");
  fprintf(fp, "                         0: merge same words at same location\n");
  fprintf(fp, "                        >0: merge same words around the margin\n");
#ifdef GRAPHOUT_DEPTHCUT
  fprintf(fp, "    [-graphcut num]     graph cut depth at postprocess (-1: disable)(%d)\n", jconf->search_root->graph.graphout_cut_depth);
#endif
#ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP
  fprintf(fp, "    [-graphboundloop num] max. num of boundary adjustment loop (%d)\n", jconf->search_root->graph.graphout_limit_boundary_loop_num);
#endif
#ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION
  fprintf(fp, "    [-graphsearchdelay] inhibit search termination until 1st sent. found\n");
  fprintf(fp, "    [-nographsearchdelay] disable it (default)\n");
#endif

  fprintf(fp, "\n Forced Alignment:\n");
  fprintf(fp, "    [-walign]           optionally output word alignments\n");
  fprintf(fp, "    [-palign]           optionally output phoneme alignments\n");
  fprintf(fp, "    [-salign]           optionally output state alignments\n");
#ifdef CONFIDENCE_MEASURE
  fprintf(fp, "\n Confidence Score:\n");
#ifdef CM_MULTIPLE_ALPHA
  fprintf(fp, "    [-cmalpha f t s]    CM smoothing factor        (from, to, step)\n");
#else
  fprintf(fp, "    [-cmalpha value]    CM smoothing factor                    (%f)\n", jconf->search_root->annotate.cm_alpha);
#endif
#ifdef CM_SEARCH_LIMIT
  fprintf(fp, "    [-cmthres value]    CM threshold to cut hypo on 2nd pass   (%f)\n", jconf->search_root->annotate.cm_cut_thres);
#endif
#endif /* CONFIDENCE_MEASURE */
  fprintf(fp, "\n Message Output:\n");
  fprintf(fp, "    [-fallback1pass]    use 1st pass result when search failed\n");
  fprintf(fp, "    [-progout]          progressive output in 1st pass\n");
  fprintf(fp, "    [-proginterval]     interval of progout in msec           (%d)\n", jconf->search_root->output.progout_interval);

  fprintf(fp, "\n-------------------------------------------------\n");

  j_jconf_free(jconf);

  /* output application-side options */
  useropt_show_desc(fp);

}