是否有可能告诉luis从给定文本中提取特定值?

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

我想创建一个聊天机器人,可以跟踪包(以及更多的东西)。我对所有这些意图和实体都很新。我的目标是,如果我对聊天机器人说“跟踪包[PACKAGEID]”或“你能找到我的包裹吗?”并且luis应该返回意图和[PACKAGEID]。这可能吗?或者如果没有,是否还有其他我可以使用的东西(最好是如果这是来自微软,因为商业的东西......是的)

亲切的问候,我....嘿!

botframework chatbot luis
2个回答
0
投票

要满足您的要求,您可以尝试以下步骤:

1)添加一个名为PackageID的简单实体

2)为PackageID添加phrase list

enter image description here

3)添加名为FindPackage的意图并添加一些示例话语,然后在话语中标记实体。

enter image description here

4)训练(并发布)应用程序

测试结果:

enter image description here

注意:

我对所有这些意图和实体都很新。

您可以在LUIS documentation中获得有关LUIS应用程序关键概念的更多信息。


0
投票

如果您知道“PACKAGEID”的所有可能格式,那么您可以使用“Regex”类型的实体

1)点击enter image description here

2)创建正则表达式定义。以下示例匹配所有PACKAGEID-s

从“KQ”开始,然后是8到10个数字,以“DE”结尾

enter image description here

3)如果你试试“你能找到kq123456789de吗?”然后你得到以下结果

{
  "query": "could you please find kq123456789de for me?",
  "topScoringIntent": {
    "intent": "Status",
    "score": 0.9369452
  },
  "intents": [
    {
      "intent": "Status",
      "score": 0.9369452
    },
    ...
  ],
  "entities": [
    {
      "entity": "kq123456789de",
      "type": "PACKAGEID",
      "startIndex": 22,
      "endIndex": 34
    }
  ]
}
© www.soinside.com 2019 - 2024. All rights reserved.