添加意向以确定用户的话语意向Add intents to determine user intention of utterances

向 LUIS 应用添加意向,识别具有相同意向的问题或命令组。Add intents to your LUIS app to identify groups of questions or commands that have the same intention.

在 LUIS 门户中,可以依次转到顶部导航栏的“生成”部分和左侧面板的“意向”来管理意向 。In the LUIS portal, Intents are managed from top navigation bar's Build section, then from the left panel's Intents.

向应用程序添加意向Add an intent to your app

  1. 登录到 LUIS 门户,选择“订阅”和“创作资源”以查看分配给该创作资源的应用。Sign in to the LUIS portal, and select your Subscription and Authoring resource to see the apps assigned to that authoring resource.

  2. 在“我的应用”页上选择应用名称以打开应用。Open your app by selecting its name on My Apps page.

  3. 在“意向”页上,选择“+ 创建” 。On the Intents page, select + Create.

  4. 在“创建新意向”对话框中,输入意向名称(例如 ModifyOrder),然后选择“完成” 。In the Create new intent dialog box, enter the intent name, for example ModifyOrder, and select Done.

    添加意向Add Intent

    意向需要示例言语,以便在已发布的预测终结点上预测言语。The intent needs example utterances in order to predict utterances at the published prediction endpoint.

添加示例话语Add an example utterance

示例表述是用户问题或命令的文本示例。Example utterances are text examples of user questions or commands. 若要传授语言理解 (LUIS) 何时预测这种意向,需将示例言语添加到意向。To teach Language Understanding (LUIS) when to predict this intent, you need to add example utterances to an intent. LUIS 需要 15 到 30 个示例言语才能开始了解意向。LUIS needs in the range of 15 to 30 example utterances to begin understanding the intent. 请不要批量添加示例言语。Do not add example utterances in bulk. 应当慎重选择每个言语,应考虑它与意向中已有的言语有何不同之处。Each utterance should be carefully chosen for how it is different than examples already in the intent.

  1. 在意向详细页中,在意向名称下的文本框中输入期望用户输入的相关言语(例如 Deliver a large cheese pizza),然后按 Enter。On the intent details page, enter a relevant utterance you expect from your users, such as Deliver a large cheese pizza in the text box below the intent name, and then press Enter.

    意向详细信息页的屏幕截图,其中突出显示了言语Screenshot of Intents details page, with utterance highlighted

    LUIS 会将所有言语转换为小写,并在连字符等标记的两侧添加空格。LUIS converts all utterances to lowercase and adds spaces around tokens such as hyphens.

意向预测错误Intent prediction errors

当未使用受过训练的应用来预测意向的言语时,将确定为一个意向预测错误。An intent prediction error is determined when the utterance is not predicted with the trained app for the intent.

  1. 若要找出并解决言语预测错误,请使用“不正确”或“不明确”这两个“筛选器”选项。To find utterance prediction errors and fix them, use the Filter options of Incorrect and Unclear.

    若要找出并修复言语预测错误,请使用“筛选器”选项。To find utterance prediction errors and fix them, use the Filter option.

  2. 若要在“意向详细信息”页面上显示分数值,请从“查看”选项菜单中选择“显示详细意向分数” 。To display the score value on the Intent details page, select Show details intent scores from the View options menu.

    应用筛选器和视图以后,如果示例话语出现错误,则示例话语列表会显示话语和问题。When the filters and view are applied, and there are example utterances with errors, the example utterance list shows the utterances and the issues.

每一行会显示当前训练的示例话语预测分数、最接近的对手的分数,以及这两个分数之间的差异。Each row shows the current training's prediction score for the example utterance, the nearest rival's score, which is the difference in these two scores.

修复意向Fixing intents

若要了解如何修复意向预测错误,请使用摘要仪表板To learn how to fix intent prediction errors, use the Summary Dashboard. 摘要仪表板提供对活动版本的上一次训练的分析,并提供排名靠前的建议,用于修复模型。The summary dashboard provides analysis for the active version's last training and offers the top suggestions to fix your model.

使用上下文工具栏Using the contextual toolbar

上下文工具栏提供其他操作:The context toolbar provides other actions:

  • 编辑或删除示例言语Edit or delete example utterance
  • 将示例言语重新分配给其他意向Reassign example utterance to a different intent
  • 筛选和查看:仅显示包含已筛选实体的言语或查看可选详细信息Filters and views: only show utterances containing filtered entities or view optional details
  • 搜索示例言语Search through example utterances

在对模型进行意向更改后对应用进行培训Train your app after changing model with intents

添加、编辑或删除意向后,请训练发布应用,以便将更改应用到终结点查询。After you add, edit, or remove intents, train and publish your app so that your changes are applied to endpoint queries. 不要在每次更改后进行训练。Do not train after every single change. 在经过一系列更改后进行训练。Train after a group of changes.

后续步骤Next steps

详细了解如何添加包含实体的示例话语Learn more about adding example utterances with entities.