Alexa技能没有发送正确的意图

时间:2017-03-22 23:27:52

标签: alexa alexa-skills-kit alexa-skill

对于我正在撰写的Alexa技能,我有以下设置:

意图架构

{
  "intents": [
    {
      "intent": "AddToGroceriesIntent",
      "slots": [
        {
          "name": "GroceriesItems",
          "type": "GROCERIES_ITEMS"
        }
      ]
    },
    {
      "intent": "GetGroceriesIntent"
    },
    {
      "intent": "ClearGroceriesIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    },
    {
      "intent": "AMAZON.StopIntent"
    },
    {
      "intent": "AMAZON.CancelIntent"
    }
  ]
}

示例话语

AddToGroceriesIntent to add {GroceriesItems}
AddToGroceriesIntent to add {GroceriesItems} to shopping list
AddToGroceriesIntent to add {GroceriesItems} to the shopping list
AddToGroceriesIntent to add {GroceriesItems} to the list
GetGroceriesIntent list
GetGroceriesIntent shopping list
GetGroceriesIntent for the shopping list
GetGroceriesIntent for the list
GetGroceriesIntent what's on my shopping list
GetGroceriesIntent what's on the shopping list
GetGroceriesIntent what's on the list
GetGroceriesIntent what's on my list
GetGroceriesIntent what is on my shopping list
GetGroceriesIntent what is on the shopping list
GetGroceriesIntent what is on the list
GetGroceriesIntent what is on my list
ClearGroceriesIntent to clear my shopping list
ClearGroceriesIntent to clear my list
ClearGroceriesIntent to clear the shopping list
ClearGroceriesIntent to clear the list
ClearGroceriesIntent to empty my shopping list
ClearGroceriesIntent to empty my list
ClearGroceriesIntent to empty the shopping list
ClearGroceriesIntent to empty the list
ClearGroceriesIntent to delete my shopping list
ClearGroceriesIntent to delete my list
ClearGroceriesIntent to delete the shopping list
ClearGroceriesIntent to delete the list

当Alexa听到时:

  

alexa要求我的应用清除我的购物清单

正如所料,发送了正确的 ClearGroceriesIntent 。然而,当Alexa听到时:

  

alexa要求我的应用清除 购物清单

发送 GetGroceriesIntent

此问题无法由服务模拟器复制 - 它可以正常工作。虽然(根据历史记录)Alexa听到的内容与我在测试表中输入的内容完全相同,但只是在演讲中它才会变得混乱。

(所有AddToGroceriesIntent和GetGroceriesIntent话语按预期工作)

1 个答案:

答案 0 :(得分:3)

可能有帮助的一个建议是更改您的样本话语以删除连接词 - 在您的情况下'to'和'for'不应该在示例话语中,参考these docs下的'调用技巧具体请求(意图)'。我不确定这是否能解决问题,但无论如何都要做好事。如果问题仍然存在,您可能会遇到this discussion关于NLP如何总是返回您的意图的情况 - 即使它不理解,它只会选择一个。也许它常常在不理解时选择GetGroceriesIntent。