# ASR Engine model configuration file.
# This file includes only default paths and options, and serves as an educational template.
# If this file were missing, or if options were unspecified, the ASR Engine would log warnings.

# IMPORTANT: this model configuration file should be placed at conf/model.conf and the model file
# paths that it specifies should be relative to the parent directory of this file.
# (e.g. do not specify --metadata=../metadata.json relative to this model configuration file.)

# NOTE: it is possible to specify absolute paths, e.g. --am=/any/arbitrary/dir/and/filename.mdl or
# even double-dotted relative paths, e.g. --am=../some-tied-asr-model/am/final.mdl
# However, this is not recommended as the model directories would not be self-contained or portable.

# Recommended: this metadata should at least specify the "language" field so that this ASR model may
# be matched to an NLP model to use as default for clients that omit an "nlp-model" request option.
--metadata=metadata.json

# Required ASR model files. These are standard Kaldi files with very specific structure and meaning.
--am=am/final.mdl
--graph=graph/HCLG.fst.gz
--word-boundary=graph/phones/word_boundary.int
--words=graph/words.txt

# While MFCC is the Kaldi default, it is best to be explicit about this.
# Other possible feature types, for example:
# --feature-type=fbank
# --feature-type=plp
--feature-type=mfcc

# While Kaldi will assume default values if this file is unspecified, it is best to be explicit.
# In particular, the Kaldi default values are intended for traditional low-resolution cepstra.
# The option name and default file path should match --feature-type specified above.  For example:
# --fbank-config=conf/fbank.conf
# --plp-config=conf/plp.conf
--mfcc-config=conf/mfcc.conf

# Uncomment below if the acoustic model uses ivectors.
# Many Kaldi model recipes use ivectors, because they marginally improve accuracy in research tests.
# However, ivectors might not work well with real-world audio, especially when speakers are mixed.
# --ivector-extraction-config=ivector/ivector.conf

# These models files are required to enable certain ASR Engine commands that dynamically create or
# modify the decoding graph.  If either is missing, those commands will be disabled.
--phones=graph/phones.txt
--tree=am/tree

# The Kaldi defaults for these options are 0.1 and 1, respectively, but that's somewhat outdated.
# More modern Kaldi models use a "chain" architecture for which settings of 1.0 and 3 are better.
# If this model configuration file is missing, the Kaldi defaults will be ignored in favor of the
# chain defaults; the Engine warns if the model configuration file exists but doesn't specify them.
--acoustic-scale=1.0
--frame-subsampling-factor=3

# The Kaldi default for this option is 0, which is generally appropriate for TDNNF acoustic models.
# However, some alternative models may require setting this option, e.g. to 50 or so.
--extra-left-context-initial=0

# These options set default values that the ASR Engine will use for the respective request options.
# Overriding these may be useful if the Engine operator or model packager knows that it will always
# improve performance -- though it's generally best if Engine clients set this to suit their tasks.
--sip-rate=0.0
--wip=0.0

# This option should be set to the corresponding position-dependent labels in the --phones file.
# An unspecified or empty string value causes the ASR Engine to infer appropriate phone symbols.
# NOTE: this differs from Kaldi's behavior of failing to validate the option at runtime.
--endpoint.silence-phones=1:2:3:4:5:11:12:13:14:15   # sil and noise

# Like --endpoint.silence-phones, but used with the Engine-specific "sip-rate" request option.
--sip-phones=1:2:3:4:5  # sil

# Like --endpoint.silence-phones, but used to weight silence for ASR models that use ivectors.
# --ivector-silence-weighting.silence-phones=1:2:3:4:5:11:12:13:14:15   # sil and noise

# If ivectors were being used, this would similarly set the default for the client request option
# named "ivector-silence-weight".  Adjusting this setting, e.g. to 0.001, may improve robustness in
# noisy conditions when ivectors are being used.
# --ivector-silence-weighting.silence-weight=1.0
