Inverse text normalization API of streaming ASR for various programming languages (#1022)
This commit is contained in:
@@ -85,6 +85,10 @@ larger than this value. Used only when --enable-endpoint is true.")]
|
||||
[Option("hotwords-score", Required = false, Default = 1.5F, HelpText = "hotwords score")]
|
||||
public float HotwordsScore { get; set; }
|
||||
|
||||
[Option("rule-fsts", Required = false, Default = "",
|
||||
HelpText = "If not empty, path to rule fst for inverse text normalization")]
|
||||
public string RuleFsts { get; set; }
|
||||
|
||||
|
||||
[Option("files", Required = true, HelpText = "Audio files for decoding")]
|
||||
public IEnumerable<string> Files { get; set; }
|
||||
@@ -189,6 +193,7 @@ to download pre-trained streaming models.
|
||||
config.Rule3MinUtteranceLength = options.Rule3MinUtteranceLength;
|
||||
config.HotwordsFile = options.HotwordsFile;
|
||||
config.HotwordsScore = options.HotwordsScore;
|
||||
config.RuleFsts = options.RuleFsts;
|
||||
|
||||
OnlineRecognizer recognizer = new OnlineRecognizer(config);
|
||||
|
||||
|
||||
28
dotnet-examples/online-decode-files/run-transducer-itn.sh
Executable file
28
dotnet-examples/online-decode-files/run-transducer-itn.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Please refer to
|
||||
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20-bilingual-chinese-english
|
||||
# to download the model files
|
||||
|
||||
set -ex
|
||||
if [ ! -d ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
|
||||
tar xvf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
|
||||
rm sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
|
||||
fi
|
||||
|
||||
if [ ! -f ./itn-zh-number.wav ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn-zh-number.wav
|
||||
fi
|
||||
|
||||
if [ ! -f ./itn_zh_number.fst ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst
|
||||
fi
|
||||
|
||||
dotnet run -c Release \
|
||||
--tokens ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/tokens.txt \
|
||||
--encoder ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/decoder-epoch-99-avg-1.int8.onnx \
|
||||
--joiner ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--decoding-method greedy_search \
|
||||
--files ./itn-zh-number.wav
|
||||
Reference in New Issue
Block a user