Add timestamps and tokens for .Net's online models. (#690)
This commit is contained in:
@@ -226,10 +226,16 @@ to download pre-trained streaming models.
|
||||
// display results
|
||||
for (int i = 0; i != files.Length; ++i)
|
||||
{
|
||||
var text = recognizer.GetResult(streams[i]).Text;
|
||||
OnlineRecognizerResult r = recognizer.GetResult(streams[i]);
|
||||
var text = r.Text;
|
||||
var tokens = r.Tokens;
|
||||
Console.WriteLine("--------------------");
|
||||
Console.WriteLine(files[i]);
|
||||
Console.WriteLine(text);
|
||||
Console.WriteLine("text: {0}", text);
|
||||
Console.WriteLine("tokens: [{0}]", string.Join(", ", tokens));
|
||||
Console.Write("timestamps: [");
|
||||
r.Timestamps.ToList().ForEach(i => Console.Write(String.Format("{0:0.00}", i) + ", "));
|
||||
Console.WriteLine("]");
|
||||
}
|
||||
Console.WriteLine("--------------------");
|
||||
}
|
||||
|
||||
@@ -6,10 +6,8 @@
|
||||
|
||||
set -ex
|
||||
if [ ! -d ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 ]; then
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
|
||||
cd sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
|
||||
git lfs pull --include "*.onnx"
|
||||
cd ..
|
||||
wget -q 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
|
||||
fi
|
||||
|
||||
dotnet run -c Release \
|
||||
|
||||
Reference in New Issue
Block a user