【问题标题】:Alexa Custom Slot picking up additional wordsAlexa Custom Slot 拾取额外的单词
【发布时间】:2017-06-25 00:04:11
【问题描述】:

我正在尝试为英国邮政编码(例如 CB1 1PT)创建自定义插槽。我设法在 10 月左右完成了这项工作,但是,我回到了这个项目,看起来亚马逊已经更新了很多东西。

这是我的意图架构:

{
  "intents": [
    {
      "intent": "GetOutages",
      "slots": [
        {
          "name": "postcode",
          "type": "LIST_OF_POSTCODES"
        }
      ]
    },
    {
      "intent": "GetCoverage",
      "slots": [
        {
          "name": "postcode",
          "type": "LIST_OF_POSTCODES"
        }
      ]
    },
    {
      "intent": "AMAZON.StopIntent",
      "slots": []
    },
    {
      "intent": "AMAZON.CancelIntent",
      "slots": []
    }
  ]
}

自定义插槽类型:

LIST_OF_POSTCODES S L six six D Y | C B one one P T | R G five four W L | G U one five one P B

一些示例话语:

GetOutages  outage info for {postcode}
GetOutages  fault info for {postcode}
GetOutages  information for {postcode}
GetOutages  outage information for {postcode}
GetOutages  fault information for {postcode}

问题是,当我尝试从插槽中检索值时,它似乎正在拾取完整的句子:

{  
   name:'GetOutages',
   slots:{  
      postcode:{  
         name:'postcode',
         value:'information for r g 54 w l'
      }
   }
}

有人有什么建议吗?

【问题讨论】:

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


    【解决方案1】:

    不是一个真正正确的答案,但有一些想法......

    您提供了示例话语,但在您的其余话语中,是否存在任何太短/通用以至于它们可能会被无意匹配,然后大部分用户的实际话语被放入邮政编码的内容?

    另外,我想知道你的那个位置的单词列表是什么?由于它仅限于 65K 件商品,您无法提供所有邮政编码,那么您采取什么捷径?

    最后,您真正需要的当然是英国邮政编码的内置插槽类型,就像美国邮政编码一样。这是针对它的 ASK 功能请求,并注意指向建议的止损的链接:
    https://forums.developer.amazon.com/content/idea/41072/built-in-slot-type-for-uk-postcodes.html

    更正:内置了各种地址和城市,但它们也不支持美国邮政编码,所以我猜人们一定是在使用 AMAZON.NUMBER。

    【讨论】:

      猜你喜欢
      • 2016-04-25
      • 2020-06-12
      • 2022-11-21
      • 1970-01-01
      • 1970-01-01
      • 2016-05-21
      • 2019-07-15
      • 1970-01-01
      • 2016-07-28
      相关资源
      最近更新 更多