语音偏见是什么意思,以及如何在Google Actions AppResponse中使用SpeechBiasHints [英] What is meant by speech bias and how to use speechBiasHints in google-actions appResponse

查看:77
本文介绍了语音偏见是什么意思,以及如何在Google Actions AppResponse中使用SpeechBiasHints的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用动作SDK在 Google动作中构建了一个应用。应用程序请求和应用程序响应正常,之前我已经在AppResponse中创建了ExpectedInput部分,而没有使用SpeechBiasingHints,但是现在我想使用它,并且找不到关于SpeechBiasHints的任何信息。

I've build an app in "Actions on google" using actions SDK. App request and App response works fine, earlier i've created expectedInput section in AppResponse without using speechBiasingHints, but now i want to use it, and i can't find any information about speechBiasHints.

我的意思是我需要以下信息:

I mean i need info on:


  • 语音偏见是什么

  • What is meant by speech bias

您能否提供一个有关如何使用SpeechBiasingHints

Can you provide an example on how to use speechBiasingHints

推荐答案

语音偏见正在影响语音对文本的识别。因此,例如,您可以在此处添加名称和其他插槽等。

Speech biases are influencing the speech to text recognition. So you can for example add here names and other slots etc.

例如,您有一家名为King Thegeorge的酒店,可以添加它。因此,谷歌将尝试识别它并将字符串传递给您。

For example you have a Hotel named King Thegeorge you can add it. So google will try to recognize it and deliver the String to you.

但有一个问题,您如何使用其余的检查输入?您是否找到了一种方法,可以给他可能的意图,并在您做出回应后将其放入请求中?

but one question, how you use the rest of the inspected input? Do you found a way to give him the possible intents and got them in the request after your response?

您可以像这样使用它们(插槽是一个数组,消息a字符串):

you can use them like that (slots is an array, message a string):

function answerWithMessage(message,slots){
  let token = {
    "state":null,
    "data":{}
  };

  let jsonResponse = {
        conversationToken: JSON.stringify(token),
        expectUserResponse: true,
        expectedInputs: [
            {
                inputPrompt: {
                    initialPrompts: [
                        {
                            textToSpeech: message
                        }
                    ],
                    noInputPrompts: []
                },
                possibleIntents: [
                    {
                        intent: "actions.intent.TEXT"
                    }
                ],
                speechBiasingHints: slots
            }
        ]
    };
  return JSON.stringify(jsonResponse,null, 4);
}

如果您自己创建json响应

if you create the json response by yourself

这篇关于语音偏见是什么意思,以及如何在Google Actions AppResponse中使用SpeechBiasHints的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆