Add C API for streaming HLG decoding (#734)
This commit is contained in:
19
scripts/dotnet/examples/streaming-hlg-decoding.csproj
Normal file
19
scripts/dotnet/examples/streaming-hlg-decoding.csproj
Normal file
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>streaming_hlg_decoding</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user