Luis测试工具的日期时间不同于本地解析的日期时间

问题描述 投票:0回答:1

我有一个针对机器人技能的Luis模型。我正在使用预建的datetime实体作为日期。

当我在Luis门户网站的测试工具上提供诸如“在本周末在[专业术语]卖出5k专业术语]]的样本话语时,我得到了期望的响应(如下所示)。 timex为2020-W02-WE,并解析为1/11-1/13。

请注意,在下面的示例中,我使用“本周末”作为查询,但是无论我输入的语言是否与我的技能意图相匹配,它都可以解决该问题。在示例中,为简单起见,使用了“本周末”。

预期:

{
  "query": "this weekend",
  "prediction": {
    "normalizedQuery": "this weekend",
    "topIntent": "None",
    "intents": {
      "None": {
        "score": 0.8771556
      }
    },
    "entities": {
      "datetimeV2": [
        {
          "type": "daterange",
          "values": [
            {
              "timex": "2020-W02-WE",
              "start": "2020-01-11",  *** Saturday ***
              "end": "2020-01-13"     ***  Monday  ***
            }
          ]
        }
      ],
      "$instance": {
        "datetimeV2": [
          {
            "type": "builtin.datetimeV2.daterange",
            "text": "this weekend",
            "startIndex": 0,
            "length": 12,
            "modelTypeId": 2,
            "modelType": "Prebuilt Entity Extractor",
            "recognitionSources": [
              "model"
            ]
          }
        ]
      }
    }
  }
}

问题是,当我在本地使用相同的语音时,我得到的日期范围代表整个星期1/6/2020-1/13/2020(星期一-星期一)。 Timex是相同的;但是,当我解决它时,我得到了不同的价值。

路易斯在本周末使用发声对模拟器的回应:

{
  "recognizerResult": {
    "alteredText": null,
    "entities": {
      "$instance": {
        "datetime": [
          {
            "endIndex": 12,
            "startIndex": 0,
            "text": "this weekend",
            "type": "builtin.datetimeV2.daterange"
          }
        ]
      },
      "datetime": [
        {
          "timex": [
            "2020-W02-WE"
          ],
          "type": "daterange"
        }
      ]
    },
    "intents": {
      "None": {
        "score": 0.8771556
      }
    },
    "text": "this weekend"
  }
}
// 2020-W01-WE - This should resolve to weekend; doesn't work locally, works on Luis. 
Resolution resolution = 
  TimexResolver.Resolve(((List<string>)options.Entities.datetime[0].Expressions).ToArray());

var start = resolution.Values?[0].Start; // 01/06/2020
var end = resolution.Values?[0].End;     // 01/13/2020

关于我在解决问题上做错了什么的想法?

我有一个针对机器人技能的Luis模型。我正在使用预建的datetime实体作为日期。当我在Luis门户上提供诸如“本周末在[专业术语]卖出5k [专业术语]””这样的示例语音时,...'

microsoft-cognitive luis timex
1个回答
0
投票

您是对的,这看起来应该可以工作。我认为这是TimexResolver中的错误,因此我编写了一个单元测试并将PR提交给团队-您可以看到它here(讽刺的是PR“ 2020”)。

© www.soinside.com 2019 - 2024. All rights reserved.