Alexa Trivia游戏自定义插槽类型的答案无法识别错误答案

时间:2018-10-29 23:56:13

标签: node.js alexa alexa-skills-kit

我为我的Alexa琐事游戏创建了自定义插槽类型。琐事问题的答案可以是任何东西:单词,数字,短语,名称。我将所有正确答案插入了“广告位价值”。但问题是,技能无法识别任何错误答案。响应意图只是不会被触发。而是说立即提示文本。有没有可能教它理解任何单词作为回应? 我的互动模型是:

        "intents": [
            {
                "name": "AMAZON.CancelIntent",
                "samples": []
            },
            {
                "name": "AMAZON.HelpIntent",
                "samples": []
            },
            {
                "name": "AMAZON.StopIntent",
                "samples": []
            },
            {
                "name": "AnswerIntent",
                "slots": [
                    {
                        "name": "one",
                        "type": "RoundAnswer"
                    },
                    {
                        "name": "two",
                        "type": "RoundAnswer"
                    }
                ],
                "samples": [
                    "The answers are First {one} Second {two}",
                    "my answers are First {one}  Second {two}",
                    "first answer is {one} Second answer is {two} ",
                    "{one} and {two}",
                    "{one}  {two} ",
                    "{one}",
                    "The answer is {one} "
                ]
            },
            {
                "name": "DontKnowIntent",
                "slots": [],
                "samples": [
                    "i don't know",
                    "don't know",
                    "i don't know that one",
                    "dunno",
                    "skip",
                    "i don't know that",
                    "who knows",
                    "i don't know this question"
                ]
            },
            {
                "name": "AMAZON.StartOverIntent",
                "samples": [
                    "let's start from the beginning",
                    "start from the beginning",
                    "start game",
                    "new game",
                    "start",
                    "start new game"
                ]
            },
            {
                "name": "AMAZON.RepeatIntent",
                "samples": []
            },
            {
                "name": "AMAZON.YesIntent",
                "samples": []
            },
            {
                "name": "AMAZON.NoIntent",
                "samples": []
            },
            {
                "name": "AMAZON.NavigateHomeIntent",
                "samples": []
            }
        ],
        "types": [
            {
                "name": "RoundAnswer",
                "values": [
                    {
                        "name": {
                            "value": "thirty six"
                        }
                    },
                    {
                        "name": {
                            "value": "Could not swim"
                        }
                    },
                    {
                        "name": {
                            "value": "Dentist"
                        }
                    },
                    {
                        "name": {
                            "value": "Black mud"
                        }
                    },
                    {
                        "name": {
                            "value": "Fireball"
                        }
                    },
                    {
                        "name": {
                            "value": "Comet"
                        }
                    },
                    {
                        "name": {
                            "value": "13,000"
                        }
                    }
                    ...many more here

                ]
            }
        ]
    },
    "dialog": {
        "intents": [
            {
                "name": "AnswerIntent",
                "confirmationRequired": false,
                "prompts": {},
                "slots": [
                    {
                        "name": "one",
                        "type": "RoundAnswer",
                        "confirmationRequired": false,
                        "elicitationRequired": true,
                        "prompts": {
                            "elicitation": "Elicit.Slot.1498167634260.856164267644"
                        }
                    },
                    {
                        "name": "two",
                        "type": "RoundAnswer",
                        "confirmationRequired": false,
                        "elicitationRequired": false,
                        "prompts": {}
                    }
                ]
            }
        ],
        "delegationStrategy": "SKILL_RESPONSE"
    },
    "prompts": [
        {
            "id": "Confirm.Slot.1498167634260.856164267644",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.534517403250",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.145008767498",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.1214922796775",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Elicit.Slot.1498167634260.856164267644",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "what's the answer?"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.1519619016259",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.1412749795564",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Slot.1498167634260.1335829309782",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "ok"
                }
            ]
        },
        {
            "id": "Confirm.Intent.654381803412",
            "variations": [
                {
                    "type": "PlainText",
                    "value": "are your answers final?"
                }
            ]
        }
    ]
}

1 个答案:

答案 0 :(得分:0)

仅当发声中包含的广告位与交互模型中硬编码的广告位值匹配时,Alexa才调用正确的意图。

我对您没有什么建议

  1. 与其直接猜测答案,不如让用户说出正确的选项 例如: Alexa:印度的首都是什么?选项a)德里选项b)海得拉巴 用户:选项a

    是将选项a和选项b注册为交互模型中的广告位值并进行匹配 答案的这些选项取决于您如何设计代码/ json或db(我建议 答案应该在键值对行{a:Delhi,b:Hyderabad,答案:a})

  2. 如果您注册了所有正确和错误的答案,即问题的所有选项 在您的互动模型中,那么alexa会识别广告位值并调用 正确的意图。但是有时用户可能会说MJ而不是Michael Jackson,所以您有 也添加同义词,最好选择第一个点