【问题标题】:Export 'Final' output of ExampleStreaming from Watson Unity SDK从 Watson Unity SDK 导出 ExampleStreaming 的“最终”输出
【发布时间】:2019-01-22 01:23:14
【问题描述】:

我正在尝试将语音的“最终”结果从 Watson Unity SDK 的 ExampleStreaming 脚本导出为文本。

我正在尝试将它附加到另一个 SDK(Affectiva)的 CSV 输出中。 确保我仅捕获 ResultsField 的最终输出 + 时间戳而不是临时响应的最佳方法是什么?

【问题讨论】:

    标签: unity3d ibm-watson watson-conversation


    【解决方案1】:

    SpeechRecognitionResult 有一个final 属性。您可以查找此布尔值并仅保存最终结果。来自ExampleStreaming.cs

    private void OnRecognize(SpeechRecognitionEvent result, Dictionary<string, object> customData)
    {
        if (result != null && result.results.Length > 0)
        {
            foreach (var res in result.results)
            {
                foreach (var alt in res.alternatives)
                {
                    if (res.final)
                    {
                        //  do something
                    }
                }
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2018-02-14
      • 2016-06-24
      • 1970-01-01
      • 2019-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 2023-03-27
      相关资源
      最近更新 更多