连接到LUIS时,“forceset”参数的作用是什么

时间:2016-11-28 18:32:46

标签: luis

在我的LUIS应用程序中,我有一个名为GetWeather的意图,需要设置位置。 GetWeather intent with Location as required parameter

使用查询

连接到应用时
  

伦敦的天气是什么

它正确返回

{
  "query": "what is the weather in london",
  "topScoringIntent": {
    "intent": "GetWeather",
    "score": 0.999875546,
    "actions": [
      {
        "triggered": true,
        "name": "GetWeather",
        "parameters": [
          {
            "name": "Location",
            "type": "Location",
            "required": true,
            "value": [
              {
                "entity": "london",
                "type": "Location",
                "resolution": {}
              }
            ]
          }
        ]
      }
    ]
  },
  "entities": [
    {
      "entity": "london",
      "type": "Location",
      "startIndex": 23,
      "endIndex": 28,
      "score": 0.832388461,
      "resolution": {}
    }
  ],
  "dialog": {
    "contextId": "e1df6c2d-e691-4fc6-89f2-3ee2ef519724",
    "status": "Finished"
  }
}

如果我改为使用查询

  

天气是什么

它返回以下预期结果。

{
  "query": "what is the weather",
  "topScoringIntent": {
    "intent": "GetWeather",
    "score": 1.0,
    "actions": [
      {
        "triggered": false,
        "name": "GetWeather",
        "parameters": [
          {
            "name": "Location",
            "type": "Location",
            "required": true,
            "value": null
          }
        ]
      }
    ]
  },
  "entities": [],
  "dialog": {
    "prompt": "Where",
    "parameterName": "Location",
    "parameterType": "Location",
    "contextId": "3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1",
    "status": "Question"
  }
}

我认为在下次调用中使用contextID和forceSet参数会将参数Location设置为我发送的任何查询。我使用的连接字符串是:

https://api.projectoxford.ai/luis/v2.0/apps/{APP_ID}?subscription-key={SUBSCRIPTION_KEY}&q=london&contextid=3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1&forceset=Location

相反,我得到以下回复:

{
  "query": "london",
  "topScoringIntent": {
    "intent": "GetWeather",
    "score": 1.0,
    "actions": [
      {
        "triggered": false,
        "name": "GetWeather",
        "parameters": [
          {
            "name": "Location",
            "type": "Location",
            "required": true,
            "value": null
          }
        ]
      }
    ]
  },
  "entities": [],
  "dialog": {
    "prompt": "Where",
    "parameterName": "Location",
    "parameterType": "Location",
    "contextId": "3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1",
    "status": "Question"
  }
}

我本来期待得到像我第一次回复的回复。 我做错了什么或只是误解了forceSet参数应该做什么?

0 个答案:

没有答案