【问题标题】:Referencing multiple entities of the same type in a response在响应中引用多个相同类型的实体
【发布时间】:2016-12-21 19:05:57
【问题描述】:

我的用户输入有两个相同类型的不同实体引用,我希望能够独立引用它们,最好是在条件检查和输出中。这可能吗?

例如,用户可能输入“下午 1 点到 3 点之间”,对话显示有@sys-time:13:00:00 和@sys-time:15:00:00。我想设置一个上下文变量 $start 和另一个 $end。如何单独引用实体?

【问题讨论】:

  • 您能否提供一些显示您目前拥有的代码,以便我们为您提供更具体和相关的帮助?
  • @Bek 我发现了使用数组下标的语法。所以我有 Condition #Fixture_Future AND @sys-time.length > 1 Response ` { "output": { "text": "" }, “context”: { “start”: @sys-time[0], “end” : @sys-time[1] }, } ` 这行得通

标签: ibm-watson watson-conversation


【解决方案1】:

尝试了明显的,它有效 -> @sys-time[0]@sys-time[1]。尽管@sys-time 似乎没有引用该数组,但它看起来像是@sys-time[0] 的简写。所以解决方案是

条件 #Fixture_Future AND @sys-time.length > 1

回应

 { 
    "output": {
      "text": "<fixtures></fixtures>"
    },
    “context”: {
      “start”: @sys-time[0],
      “end”: @sys-time[1]
    },
 }

这行得通

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-13
    相关资源
    最近更新 更多