调度CLI未从Luis App传递实体 [英] Dispatch CLI not passing Entities from Luis App

查看:91
本文介绍了调度CLI未从Luis App传递实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CLI生成Dispatch模型时,它不会传递Luis应用程序中的Entities作为参考.这将严重影响调度应用程序的准确性.

When generating a Dispatch model using the CLI, it doesn't pass the Entities from the Luis app in reference. This drastically affects the accuracy of the dispatch app.

例如,对于发话我的[iPhone]无法正常工作",iPhone被附加到实体列表名称CellPhoneType. iPhone,三星,智能手机列表中有三项.

For example, for the utterance "My [iPhone] isn't working", iPhone is attached to an entity list name CellPhoneType. There are three items in the list iPhone, Samsung, Smartphone.

在机器人仿真器中,使用Dispatch,如果我写我的iPhone无法正常工作",则调度模型会按需将其传递给Luis.但是,如果我写我的智能手机无法正常工作",则分发工具会将其发送给QnA Maker.

In the bot emulator, using the Dispatch, if I write "my iPhone isn't working", the dispatch model passes it to Luis, as it should. However, if I write "my smartphone isn't working", the dispatch tool sends it over to QnA Maker.

我检查了模型,并且实体未通过引用传递.我还用简单的实体进行了测试,它们不能很好地工作.

I checked the model, and the entities are not passed in reference. I also tested with simple entities, they do not work as well.

我安装了最新版本的CLI.

I have the most recent version of the CLI installed.

这正常吗,这是一个错误吗?是否可以解决此问题?

Is this normal, is this a bug? Is there a work around to fix this?

推荐答案

在此要解决的几件事是如何构建LUIS模型以及对调度的期望. 跳到2.)(如果您是正在阅读这篇文章的用户,并且已经拥有在LUIS子模型中很好地工作的实体. @AlexandreViegas,请阅读第1点),以帮助正确地构建您的LUIS模型.正确检测调度中的意图.

So a couple things to address here with how you've built your LUIS model and what to expect from dispatch. Skip down to 2.) if you're a user who's reading this post and already has entities working in child LUIS models beautifully. @AlexandreViegas, read point 1.) to help properly build your LUIS model to detect intent properly in dispatch.

1.使用简单实体+短语列表来利用LUIS的机器学习功能,而不是列表实体

1. Use a Simple Entity + Phrase List to take Advantage of LUIS's machine learning--not List Entity

现在看来,您选择使用列表实体并不是这里的最佳方法,也不是它的预期用途.相反,列表实体用于可能具有多种引用同一事物的方式的术语.

Right now it seems like your choice of using a list entity is not the best way to go here, and not how it's intended to be used. Instead list entities are used for terms that might have multiple ways of referring to the same thing.

何时需要使用列表实体的示例

Examples of When You Would Want to Use a List Entity

例如,加利福尼亚州,卡利州,加利福尼亚州和黄金州都是指同一事物(州)的术语.您可以创建一个州"列表实体,其中包括美国的全部50个州及其昵称.现在,由于这是一个封闭的显式列表,因此在使用列表实体时没有没有机器学习-LUIS仅在存在完全匹配的文本时才检测状态"列表实体.

For example, California, Cali, CA, and The Golden State are all terms that refer to the same thing (a state). You can create a "States" list entity, include all 50 U.S. states and their nicknames. Now since this is a closed, explicit list, there is no machine learning when you use a list entity--LUIS will only detect "States" list entity if there's an exact text match.

关于何时要使用列表实体的另一个示例是学校的部门".您可能具有化学","CHEM142",化学"等含义,都是指该特定部门,而与学校中的其他部门一样.

Another example of when you would want to use list entities would be say with "Departments" for a school. You could have "chemistry", "CHEM142", "chem", etc. all meant to refer to that specific department, and do so with the rest of the departments in the school.

为什么要使用简单实体并添加短语列表

Why you want to use a Simple Entity and add a Phrase List

您可以参考我写的关于的其他 StackOverflow答案.如何创建一个简单的实体并使用短语列表增强该实体的信号.

You can refer to this other StackOverflow answer I wrote, regarding how to create a simple entity and boost the signal of the entity using a phrase list.

要完全复制上面链接中给出的答案,实质上,您希望使用一个简单的实体,因此即使未在模型中明确包含该实体,LUIS仍可以正确地将术语预测为CellPhoneType实体.

To not completely duplicate the answer given in the link above, in essence, you want to use a simple entity, so LUIS can properly predict terms as CellPhoneType entity, even though you did not explicitly include it in your model.

例如,您可能有一个Phone意图,其发音将各种单词标记为CellPhoneIntent实体.

For example you could have a Phone intent with utterances labeling various words as CellPhoneIntententity.

当我转到测试"面板时,我输入向日葵"和月光石"作为手机(可能是将来的某些电话公司以这些名称作为型号来创建电话):

When I go to the Test panel, I type in "sunflower" and "moonstone" as made up mobile phones (maybe some phone company in the future creates phones with these names as their models):

上面您可以看到LUIS正确地预测了Phone意图并正确地将sunflowermoonstone提取为CellPhoneType实体.

Above you can see LUIS correctly predicts Phone intent and correctly extracts sunflower and moonstone as CellPhoneType entities.

但是,如果我输入不存在英语的移动电话的品牌名称,例如Blackberry的"Z3"或T-Mobile的"G2X",LUIS便无法立即使用我们的模型检测到它. (请参阅2条最近的讲话).

However if I enter in brand names of mobiles that don't exist in the English language--for example Blackberry's "Z3" or T-Mobile's "G2X", LUIS cannot detect this with our model as is right now. (See 2 most recent utterances).

以上,您可以看到发话"i'd like to order a z3"和"my g2x is broken"不能正确地预测为Phone意图,也不能将z3g2x识别为CellPhoneType实体.这是短语列表的来源.如

Above you can see utterances "i'd like to order a z3" and "my g2x is broken" do not properly predict as Phone intent, nor do z3 or g2x get detected as CellPhoneType entity. This is where phrase lists come in. As specified in the docs, phrase lists are good for boosting the signal of what a cell phone type may look like, as well as adding proprietary or foreign words to your LUIS model, such as the "made-up" words of many cell phone models. Again, refer to the StackOverflow answer I linked to, if you need guidance on how to create a phrase list.

将不同型号的手机型号添加到短语列表中

2.查询直接由调度

2. Query the endpoint of the LUIS model that was created by dispatch directly

说明:

  • 在添加子LUIS模型以进行分派时,即使该子LUIS模型中包含实体,也不会出现在由分派创建的父LUIS模型的模型中.
  • li>
  • 上述项目符号的例外情况是,如果您在模式中标记了一个实体

  • When you add a child LUIS model to dispatch, even if that child LUIS model has entities in it, it will not show up in the model of the parent LUIS model created by dispatch.
  • the exception to the above bullet would be if you labelled an entity in a pattern

为什么在父LUIS模型中不需要标记实体,是因为当您调用父LUIS模型的端点时,它确实在后台进行了共享调用,所以它不需要必须两次对LUIS进行ping操作.

Why entities do not need to be labelled in the parent LUIS model, is because when you call the endpoint of the parent LUIS model, it does sort of a shared call, under the hood, so it doesn't have to ping LUIS twice.

您会在connectedServiceResult属性中看到从子LUIS模型中标记的实体

You see the entities labelled from the child LUIS model in the connectedServiceResult property

如何使用父调度LUIS应用程序从子LUIS模型中提取实体

How to extract entities from child LUIS model, using your parent dispatch LUIS app

  1. 请确保同时发布 子LUIS应用和父调度应用.

  1. Make sure to publish both the child LUIS app and the parent dispatch app.

转到父分发创建的LUIS应用,转到管理">键和端点">单击端点" ,打开浏览器选项卡,您可以在其中查询URL中的父应用在q=

Going to your parent dispatch-created LUIS app, go to Manage > Keys and Endpoints > click "Endpoint" to open a browser tab where your can query the parent app in the URL after q=

在URL中的话语中键入q=,以查看在connectedServiceResult

type in your utterances in the URL, after q= to see the entities and intents extracted from the child LUIS model under connectedServiceResult

https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?verbose=true&timezoneOffset=-360&subscription-key=b7xxxxxxxxxxxxxxxxxxxxxxxxxxxx67&q=my%20iphone%20is%20broken

{
  "query": "my iphone is broken",
  "topScoringIntent": {
    "intent": "l_Reminders",
    "score": 0.99594605
  },
  "intents": [
    {
      "intent": "l_Reminders",
      "score": 0.99594605
    },
    {
      "intent": "None",
      "score": 0.002990469
    }
  ],
  "entities": [],
  "connectedServiceResult": {
    "query": "my iphone is broken",
    "topScoringIntent": {
      "intent": "Phone",
      "score": 0.9658808
    },
    "intents": [
      {
        "intent": "Phone",
        "score": 0.9658808
      },
      {
        "intent": "Calendar.Add",
        "score": 0.0142210266
      },
      {
        "intent": "Calendar.Find",
        "score": 0.0112086516
      },
      {
        "intent": "None",
        "score": 0.009813501
      },
      {
        "intent": "Email",
        "score": 0.0025855056
      }
    ],
    "entities": [
      {
        "entity": "iphone",
        "type": "CellPhoneType",
        "startIndex": 3,
        "endIndex": 8,
        "score": 0.998970151
      }
    ]
  }
}

上面,您可以看到从分派创建的父LUIS应用正确地将发话my iphone is broken中的iphone标识为CellphoneType实体.

Above you can see that the parent LUIS app created from dispatch properly identifies iphone from the utterance my iphone is broken as a CellphoneType entity.

注意:您不会在父调度的测试"面板中看到子LUIS模型的结果,因为UI不会显示connectedServiceResult

Note: you will not see results from the child LUIS model in the Test panel of the parent dispatch, because the UI does not show connectedServiceResult

这篇关于调度CLI未从Luis App传递实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆