foreversimon
Committed by GitHub

Add HotwordsFile and HotwordsScore fields to OnlineRecognizerConfig in C# API (#675)

@@ -129,6 +129,8 @@ namespace SherpaOnnx @@ -129,6 +129,8 @@ namespace SherpaOnnx
129 Rule1MinTrailingSilence = 1.2F; 129 Rule1MinTrailingSilence = 1.2F;
130 Rule2MinTrailingSilence = 2.4F; 130 Rule2MinTrailingSilence = 2.4F;
131 Rule3MinUtteranceLength = 20.0F; 131 Rule3MinUtteranceLength = 20.0F;
  132 + HotwordsFile = "";
  133 + HotwordsScore = 2F;
132 } 134 }
133 public FeatureConfig FeatConfig; 135 public FeatureConfig FeatConfig;
134 public OnlineModelConfig ModelConfig; 136 public OnlineModelConfig ModelConfig;
@@ -158,6 +160,13 @@ namespace SherpaOnnx @@ -158,6 +160,13 @@ namespace SherpaOnnx
158 /// this value. 160 /// this value.
159 /// Used only when enable_endpoint is not 0. 161 /// Used only when enable_endpoint is not 0.
160 public float Rule3MinUtteranceLength; 162 public float Rule3MinUtteranceLength;
  163 +
  164 + /// Path to the hotwords.
  165 + [MarshalAs(UnmanagedType.LPStr)]
  166 + public string HotwordsFile;
  167 +
  168 + /// Bonus score for each token in hotwords.
  169 + public float HotwordsScore;
161 } 170 }
162 171
163 public class OnlineRecognizerResult 172 public class OnlineRecognizerResult