Language Understanding (LUIS) 的 SDK、REST 和 CLI 開發人員資源SDK, REST, and CLI developer resources for Language Understanding (LUIS)

Sdk、REST Api、CLI 可協助您以程式設計語言開發 Language Understanding (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 認知服務」管理層來建立、編輯、列出和刪除 Language Understanding 或認知服務資源。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 撰寫和預測要求Language Understanding authoring and prediction requests

Language Understanding 的服務會從您需要建立的 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

LUIS REST 規格以及所有Azure REST 規格都可在 GitHub 上公開使用。The LUIS REST specifications, along with all Azure REST specifications, are publicly available on GitHub.


撰寫和預測端點 API 都可從 REST Api 取得:Both authoring and prediction endpoint APIS are available from REST APIs:

類型Type 版本Version
編寫Authoring 2V2
預覽 V3preview V3
預測Prediction 2V2

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
在定型端點上撰寫 V2V2 Authoring on training endpoint https://{your-resource-name}{appID}/
在訓練端點上撰寫 V3V3 Authoring on training endpoint https://{your-resource-name}{appID}/
V2 預測-執行時間端點上的所有預測V2 Prediction - all predictions on runtime endpoint https://{your-resource-name}{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}{appId}/versions/{versionId}/predict?query={query}[&verbose][&log][&show-all-intents]
V3 預測-執行時間端點的位置預測V3 Prediction - slot prediction on runtime endpoint https://{your-resource-name}{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 - 字串string 僅限第 3 版V3 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 中,此功能會在參數中傳遞 queryIn V3, the functionality is passed in the query parameter.
show-all-intents 包含所有意圖的分數Include scores for all intents booleanboolean 僅限第 3 版V3 only falsefalse 傳回在「 預測 」物件中具有對應分數的所有意圖。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 - 字串string V2V2 - 適用于 datetimeV2 實體的時區。Timezone applied to datetimeV2 entities.
datetimeReference - 字串string V3V3 - 適用于 datetimeV2 實體的時區Timezone applied to datetimeV2 entities. 取代為 timezoneOffset V2。Replaces timezoneOffset from V2.

應用程式結構描述App schema

應用程式架構會以或格式匯入和匯出 .json .luThe app schema is imported and exported in a .json or .lu format.

以語言為基礎的 SdkLanguage-based SDKs

語言Language 參考文件Reference documentation 套件Package 快速入門Quickstarts
C#C# 編寫Authoring
NuGet 撰寫NuGet authoring
NuGet 預測NuGet prediction
查詢預測Query prediction
GoGo 撰寫和預測Authoring and prediction SDKSDK
JavaJava 撰寫和預測Authoring and prediction Maven 撰寫Maven authoring
Maven 預測Maven prediction
JavaScriptJavaScript 編寫Authoring
NPM 撰寫NPM authoring
NPM 預測NPM prediction
PythonPython 撰寫和預測Authoring and prediction PipPip 編寫Authoring


Language Understanding (LUIS) 提供 容器 來提供應用程式的內部部署和包含版本。Language Understanding (LUIS) provides a container to provide on-premises and contained versions of your app.

匯出和匯入格式Export and import formats

Language Understanding 能夠以 JSON 格式管理您的應用程式和其模型、 .LU (LUDown) 格式,以及 Language Understanding 容器的壓縮套件。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.


持續整合工具Continuous integration tools

Bot Framework 工具Bot Framework tools

Bot framework 以多種語言提供的 SDK ,以及使用 Azure bot service的服務形式提供。The bot framework is available as an SDK in a variety of languages and as a service using Azure Bot Service.

Bot framework 提供 數種工具 來協助 Language Understanding,包括:Bot framework provides several tools to help with Language Understanding, including:

  • Bot Framework 模擬器 -桌面應用程式,可讓 bot 開發人員測試及偵測使用 Bot Framework SDK 建立的 botBot Framework emulator - a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK
  • Bot Framework 編輯器 -適用于開發人員的整合式開發工具,以及用來建立 bot 和對話式體驗的專業團隊 Microsoft Bot FrameworkBot 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 和 PythonBot Framework Samples - in #C, JavaScript, TypeScript, and Python

下一步Next steps