在LUIS中使用分层实体作为动作过滤器

时间:2016-12-30 01:21:40

标签: machine-learning artificial-intelligence luis

我为意图添加了一个动作。

该操作需要Fruit 类型的参数。

水果是一个等级实体[香蕉,橙子,苹果]。

我预计当我通过一个苹果然后它会引发这个动作但它不会,我不知道为什么?

enter image description here

意图成功匹配但不是动作:

{
  "query": "eat an apple",
  "topScoringIntent": {
    "intent": "Eat",
    "score": 0.999997139,
    "actions": [
      {
        "triggered": false,
        "name": "Eat",
        "parameters": [
          {
            "name": "FruitType",
            "type": "Fruit",
            "required": true,
            "value": null
          }
        ]
      }
    ]
  },
  "intents": [
    {
      "intent": "Eat",
      "score": 0.999997139,
      "actions": [
        {
          "triggered": false,
          "name": "Eat",
          "parameters": [
            {
              "name": "FruitType",
              "type": "Fruit",
              "required": true,
              "value": null
            }
          ]
        }
      ]
    },
    {
      "intent": "None",
      "score": 0.04917145
    }
  ],
  "entities": [
    {
      "entity": "apple",
      "type": "Fruit::apple",
      "startIndex": 7,
      "endIndex": 11,
      "score": 0.916528642
    }
  ],
  "dialog": {
    "prompt": "FruitType missing",
    "parameterName": "FruitType",
    "parameterType": "Fruit",
    "contextId": "1b4333e4-4a00-4714-8041-4b9bacb1feb4",
    "status": "Question"
  }
}

相反,我必须专门使用水果::苹果的参数类型 - 这对我来说打败了意图的魔力。

enter image description here

{
  "query": "eat an apple",
  "topScoringIntent": {
    "intent": "Eat",
    "score": 0.999997139,
    "actions": [
      {
        "triggered": true,
        "name": "Eat",
        "parameters": [
          {
            "name": "FruitType",
            "type": "Fruit::apple",
            "required": true,
            "value": [
              {
                "entity": "apple",
                "type": "Fruit::apple",
                "resolution": {}
              }
            ]
          }
        ]
      }
    ]
  },
  "intents": [
    {
      "intent": "Eat",
      "score": 0.999997139,
      "actions": [
        {
          "triggered": true,
          "name": "Eat",
          "parameters": [
            {
              "name": "FruitType",
              "type": "Fruit::apple",
              "required": true,
              "value": [
                {
                  "entity": "apple",
                  "type": "Fruit::apple",
                  "resolution": {}
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "intent": "None",
      "score": 0.04917145
    }
  ],
  "entities": [
    {
      "entity": "apple",
      "type": "Fruit::apple",
      "startIndex": 7,
      "endIndex": 11,
      "score": 0.916528642,
      "resolution": {}
    }
  ],
  "dialog": {
    "contextId": "93839bc8-a26a-436b-90c4-842891344ac6",
    "status": "Finished"
  }
}

基本上这个限制意味着我无法拥有EatFruit意图。

相反,我必须要吃EatApple,EatBanana,EatOrange意图并不是我认为的全部意义。

我做错了还是这是怎么做的?如果这就是它的完成方式,那么分层实体的意义何在?

我也可以使用一个普通的旧实体然后我可以传递任何东西[苹果,香蕉,橙子],但它也会匹配[梨]我不想要的。

0 个答案:

没有答案