Add C API for streaming HLG decoding (#734)

This commit is contained in:
Fangjun Kuang
2024-04-05 10:31:20 +08:00
committed by GitHub
parent db67e00c77
commit dbff2eaadb
39 changed files with 839 additions and 8 deletions

View File

@@ -116,6 +116,21 @@ namespace SherpaOnnx
public int FeatureDim;
}
[StructLayout(LayoutKind.Sequential)]
public struct OnlineCtcFstDecoderConfig
{
public OnlineCtcFstDecoderConfig()
{
Graph = "";
MaxActive = 3000;
}
[MarshalAs(UnmanagedType.LPStr)]
public string Graph;
public int MaxActive;
}
[StructLayout(LayoutKind.Sequential)]
public struct OnlineRecognizerConfig
{
@@ -131,6 +146,7 @@ namespace SherpaOnnx
Rule3MinUtteranceLength = 20.0F;
HotwordsFile = "";
HotwordsScore = 1.5F;
CtcFstDecoderConfig = new OnlineCtcFstDecoderConfig();
}
public FeatureConfig FeatConfig;
public OnlineModelConfig ModelConfig;
@@ -167,6 +183,8 @@ namespace SherpaOnnx
/// Bonus score for each token in hotwords.
public float HotwordsScore;
public OnlineCtcFstDecoderConfig CtcFstDecoderConfig;
}
public class OnlineRecognizerResult