You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure AI Speech Service英文识别无标点输出问题排查

解决Azure AI语音识别C#返回无标点文本的问题

以下是几个需要排查和调整的关键配置点:

  • 显式启用标点预测
    尽管听写模式默认应包含标点,但部分场景下C# SDK需要显式开启该功能。通过SetServiceProperty补充配置:

    speechConfig.SetServiceProperty("punctuation", "true", ServicePropertyChannel.UriQueryParameter);
    
  • 正确读取Detailed格式的结果
    设置OutputFormat.Detailed后,需通过结构化结果获取带标点内容,而非直接使用顶层的DisplayText。示例代码:

    var result = await recognizer.RecognizeOnceAsync();
    if (result.Reason == ResultReason.RecognizedSpeech)
    {
        var detailedResult = result.Details as DetailedSpeechRecognitionResult;
        if (detailedResult != null)
        {
            // 获取带标点的识别结果
            var punctuatedText = detailedResult.NBest.First().Display;
            Console.WriteLine(punctuatedText);
        }
    }
    
  • 更新SDK版本
    确保使用最新稳定版的Microsoft.CognitiveServices.Speech NuGet包。旧版本可能存在听写模式与标点预测的兼容性问题,更新后可修复这类异常。

  • 验证语言代码准确性
    确认SpeechConfig.SpeechRecognitionLanguage严格设置为"en-GB",错误的语言代码(如"en-US")会导致对应语言的标点模型不生效。

内容的提问来源于stack exchange,提问作者David_Strachan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 03:37:02