用于语言理解 (LUIS) 的 SDK、REST 和 CLI 开发人员资源SDK, REST, and CLI developer resources for Language Understanding (LUIS)

SDK、REST API、CLI 用于以编程语言开发语言理解 (LUIS) 应用。SDKs, REST APIs, CLI, help you develop Language Understanding (LUIS) apps in your programming language. 管理 Azure 资源和 LUIS 预测。Manage your Azure resources and LUIS predictions.

Azure 资源管理Azure resource management

使用 Azure 认知服务的“管理”层来创建、编辑、列出和删除语言理解或认知服务资源。Use the Azure Cognitive Services Management layer to create, edit, list, and delete the Language Understanding or Cognitive Service resource.

根据以下工具来查找参考文档:Find reference documentation based on the tool:

语言理解创作和预测请求Language Understanding authoring and prediction requests

可以从需要创建的 Azure 资源访问语言理解服务。The Language Understanding service is accessed from an Azure resource you need to create. 有两个资源:There are two resources:

  • 使用 创作 资源进行训练,以便创建、编辑、训练和发布内容。Use the authoring resource for training to create, edit, train, and publish.
  • 预测 用于运行时,以便发送用户的文本并接收预测。Use the prediction for runtime to send user's text and receive a prediction.

了解 V3 预测终结点Learn about the V3 prediction endpoint.

使用认知服务示例代码,了解并使用最常见的任务。Use Cognitive Services sample code to learn and use the most common tasks.

REST 规范REST specifications

GitHub 上公开提供 LUIS REST 规范以及所有 Azure REST 规范The LUIS REST specifications, along with all Azure REST specifications, are publicly available on GitHub.

REST APIREST APIs

创作终结点 API 和预测终结点 API 都可在 REST API 中使用:Both authoring and prediction endpoint APIS are available from REST APIs:

类型Type 版本Version
创作Authoring V2V2
预览 V3preview V3
预测Prediction V2V2
V3V3

REST 终结点REST Endpoints

LUIS 目前有 2 种类型的终结点:LUIS currently has 2 types of endpoints:

  • 在训练终结点上进行创作authoring on the training endpoint
  • 运行时终结点上的查询预测。query prediction on the runtime endpoint.
目的Purpose URLURL
在训练终结点上进行 V2 创作V2 Authoring on training endpoint https://{your-resource-name}.api.cognitive.azure.cn/luis/api/v2.0/apps/{appID}/
在训练终结点上进行 V3 创作V3 Authoring on training endpoint https://{your-resource-name}.api.cognitive.azure.cn/luis/authoring/v3.0-preview/apps/{appID}/
V2 预测 - 运行时终结点上的所有预测V2 Prediction - all predictions on runtime endpoint https://{your-resource-name}.api.cognitive.azure.cn/luis/v2.0/apps/{appId}?q={q}[&timezoneOffset][&verbose][&spellCheck][&staging][&bing-spell-check-subscription-key][&log]
V3 预测 - 运行时终结点上的版本预测V3 Prediction - versions prediction on runtime endpoint https://{your-resource-name}.api.cognitive.azure.cn/luis/prediction/v3.0/apps/{appId}/versions/{versionId}/predict?query={query}[&verbose][&log][&show-all-intents]
V3 预测 - 运行时终结点上的槽预测V3 Prediction - slot prediction on runtime endpoint https://{your-resource-name}.api.cognitive.azure.cn/luis/prediction/v3.0/apps/{appId}/slots/{slotName}/predict?query={query}[&verbose][&log][&show-all-intents]

下表说明了上表中用大括号 {} 表示的参数。The following table explains the parameters, denoted with curly braces {}, in the previous table.

参数Parameter 目的Purpose
your-resource-name Azure 资源名称Azure resource name
qqueryq or query 从客户端应用程序(如聊天机器人)发送的话语文本utterance text sent from client application such as chat bot
version 10 字符版本名称10 character version name
slot productionstagingproduction or staging

REST 查询字符串参数REST query string parameters

V3 API 查询字符串参数包括:V3 API query string parameters include:

查询参数Query parameter LUIS 门户名称LUIS portal name 类型Type 版本Version 默认Default 目的Purpose
log 保存日志Save logs booleanboolean V2 和 V3V2 & V3 falsefalse 将查询存储在日志文件中。Store query in log file. 默认值为 false。Default value is false.
query - stringstring 仅 V3V3 only 无默认值 - 在 GET 请求中是必需的No default - it is required in the GET request 在 V2 中 ,要预测的言语位于 q 参数中。In V2 , the utterance to be predicted is in the q parameter.

在 V3 中 ,该功能在 query 参数中传递。In V3 , the functionality is passed in the query parameter.
show-all-intents 包括所有意向的分数Include scores for all intents booleanboolean 仅 V3V3 only falsefalse prediction.intents 对象中返回包含相应评分的所有意向。Return all intents with the corresponding score in the prediction.intents object. 意向将在父 intents 对象中作为对象返回。Intents are returned as objects in a parent intents object. 这样,便可以通过编程方式进行访问,而无需在数组中查找意向:prediction.intents.giveThis allows programmatic access without needing to find the intent in an array: prediction.intents.give. 在 V2 中,这些意向在数组中返回。In V2, these were returned in an array.
verbose 包括更多实体详细信息Include more entities details booleanboolean V2 和 V3V2 & V3 falsefalse 在 V2 中 ,如果设置为 true,则返回所有预测意向。In V2 , when set to true, all predicted intents were returned. 如果需要所有预测的意向,请使用 V3 参数 show-all-intentsIf you need all predicted intents, use the V3 param of show-all-intents.

在 V3 中 ,此参数仅提供实体预测的实体元数据详细信息。In V3 , this parameter only provides entity metadata details of entity prediction.
timezoneOffset - stringstring V2V2 - 应用于 datetimeV2 实体的时区。Timezone applied to datetimeV2 entities.
datetimeReference - stringstring V3V3 - 应用于 datetimeV2 实体的时区Timezone applied to datetimeV2 entities. 替换 V2 中的 timezoneOffsetReplaces timezoneOffset from V2.

应用架构App schema

应用架构.json.lu 格式导入和导出。The app schema is imported and exported in a .json or .lu format.

基于语言的 SDKLanguage-based SDKs

语言Language 参考文档Reference documentation 程序包Package 快速入门Quickstarts
C#C# 创作Authoring
预测Prediction
NuGet 创作NuGet authoring
NuGet 预测NuGet prediction
创作Authoring
查询预测Query prediction
GoGo 创作和预测Authoring and prediction SDKSDK
JavaJava 创作和预测Authoring and prediction Maven 创作Maven authoring
Maven 预测Maven prediction
JavascriptJavaScript 创作Authoring
预测Prediction
NPM 创作NPM authoring
NPM 预测NPM prediction
创作Authoring
预测Prediction
PythonPython 创作和预测Authoring and prediction PipPip 创作Authoring
预测Prediction

容器Containers

语言理解 (LUIS) 提供一个可提供本地版和包含版应用的容器Language Understanding (LUIS) provides a container to provide on-premises and contained versions of your app.

导出和导入格式Export and import formats

语言理解提供以 JSON 格式管理应用及其模型的功能,并提供 .LU (LUDown) 格式以及用于语言理解容器的压缩包。Language Understanding provides the ability to manage your app and its models in a JSON format, the .LU (LUDown) format, and a compressed package for the Language Understanding container.

可以通过 API 和 LUIS 门户导入和导出这些格式。Importing and exporting these formats is available from the APIs and from the LUIS portal. 此门户通过“应用”列表和“版本”列表提供导入和导出功能。The portal provides import and export as part of the Apps list and Versions list.

研讨会Workshops

Bot Framework 工具Bot Framework tools

Bot Framework 在多种语言中以 SDK 形式提供。The bot framework is available as an SDK in a variety of languages.

Bot Framework 提供有助于语言理解的多种工具,其中包括:Bot framework provides several tools to help with Language Understanding, including:

  • Bot Framework Emulator - 一款桌面应用程序,可让机器人开发人员测试和调试使用 Bot Framework SDK 构建的机器人。Bot Framework emulator - a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK
  • Bot Framework Composer - 一个集成开发工具,供开发人员和多学科团队通过 Microsoft Bot Framework 构建机器人和聊天体验Bot Framework Composer - an integrated development tool for developers and multi-disciplinary teams to build bots and conversational experiences with the Microsoft Bot Framework
  • Bot Framework 示例 - 使用 #C、JavaScript、TypeScript 和 Python 编写Bot Framework Samples - in #C, JavaScript, TypeScript, and Python

后续步骤Next steps