【问题标题】:Alexa skills - fulfilling another slot in slot filling processAlexa 技能 - 填补插槽填充过程中的另一个插槽
【发布时间】:2019-01-23 07:17:10
【问题描述】:

我正在研究一种按姓名或专业搜索医生的技能。

我有意向:FindDoctor

它有 3 个插槽:TypeNameSpecialty

这是我现在拥有的:

当用户说:

“我想找医生”

然后我的代码会将控制权委托给 Alexa 并请求Type

“好的,你是想按名字还是按专业找到它?”

如果用户要求NameSpecialty

“按专业”

我的代码将在必要的插槽中委托以实现用户的意图:

“完美,专业叫什么名字?”

而用户将实现它:

“创伤学”

我的代码会调用一个API并查找结果:

“这里是最近的创伤科医生……等等”


这就是我想要得到的:

如果机器人询问Type 会发生什么:

“好的,你是想按名字还是按专业找到它?”

而用户说:

“创伤科医生。”

那我想满足Specialty的槽位,不需要Type

但是在槽位填充时,我将用户“a {Specialty}”作为可能的答案,我不满足槽位Specialty,而是始终满足槽位Type


所以假设我总是问用户他想找到什么。当我在Type 填充 Alexa 的插槽时,有什么办法可以填充另一个插槽?

【问题讨论】:

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


    【解决方案1】:

    如果我理解正确,您想从一个意图中填充多个插槽。这是一个可能看起来像这样的示例:

    {
      "intents": [
        {
          "name": "FindDoctorIntent",
          "samples": [
            "Find a doctor",
            "Find doctor {DoctorName}",
            "{Specialty}",
            "Find a {Specialty}"
          ],
          "slots": [
            {
              "name": "Specialty",
              "type": "LIST_OF_SPECIALTIES"
            },
            {
              "name": "DoctorName",
              "type": "AMAZON.US_FIRST_NAME" // or whatever type is best suited for your usecase
            }
          ]
        }
      ],
      "types": [
        {
          "name": "LIST_OF_SPECIALTIES",
          "values": [
            {
              "id": "traumatologist",
              "name": {
                "value": "traumatologist",
                "synonyms": [
                  "traumatologist",
                  "Traumatology",
                    ...
                ]
              }
            },
            {
              "id": "other docter type",
              "name": {
                "value": "other type..",
                "synonyms": [
                     ...
                ]
              }
            }
          ]
        }
      ]
    }
    

    以下是一些可能有用的额外资源: Using Dialog Management to Capture A and B or C Slots

    另一个好问题.. 如果您的两种类型相似:Multiple intents sharing the same slot value

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-07
      • 1970-01-01
      相关资源
      最近更新 更多