【问题标题】:Setting regional culture with LUIS使用 LUIS 设置区域文化
【发布时间】:2017-10-11 14:10:22
【问题描述】:

以“2017 年 3 月 1 日”格式将日期传递给 LUIS 会返回解析为 2013 年 3 月 1 日的 builtin.datetimev2 实体。

Month first 是美国对日期字符串的约定,但在我的语言环境中,该字符串通常表示 2017 年 1 月 1 日。

这是 JSON 响应:

    {
  "entity": "23/12/17",
  "type": "builtin.datetimeV2.date",
  "startIndex": 70,
  "endIndex": 77,
  "resolution": {
    "values": [
      {
        "timex": "2017-12-23",
        "type": "date",
        "value": "2017-12-23"
      }
    ]
  }
},
{
  "entity": "3/1/18",
  "type": "builtin.datetimeV2.date",
  "startIndex": 83,
  "endIndex": 88,
  "resolution": {
    "values": [
      {
        "timex": "2018-03-01",
        "type": "date",
        "value": "2018-03-01"
      }
    ]
  }
},

【问题讨论】:

  • 您的 LUIS 项目语言值是多少? en-us?
  • @NicolasR 是的。这是。我似乎无法编辑该值。我唯一可以更改的是应用程序名称。
  • 而且创建新应用时只有一个英文选项,我假设是 en-us
  • 我很快查了一下,是的,是en-us。也许您可以尝试使用 LUIS API 来更改设置,但如果它正常工作,我会感到惊讶

标签: botframework azure-language-understanding


【解决方案1】:

builtin.datetimeV2.date 当前始终为 en-us,并且无法更改它。

您可以在此处投票的 UserVoice 请求:https://cognitive.uservoice.com/forums/551524-luis/suggestions/31549864-luis-add-support-for-english-regional-formats

抱歉,这不是您要找的答案。

【讨论】:

  • 谢谢。为 UV 请求投票
  • 我想知道响应是 en-US 最好的选择是在实体值上调用 DateTime.Parse 时传入我的本地 CultureInfo。
  • 是的,目前由开发人员确保日期是特定于文化的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-31
  • 1970-01-01
相关资源
最近更新 更多