Language Understanding (LU)

Introduction

Natural Language Understanding (LU) helps a botlet understand a user’s command. It returns the intent and entity extracted from a user’s query to help a botlet talk with user like human conversation. The LU service is provided through the prebuilt botlet called: “system.languageunderstanding”.

Prebuilt Botlet for Language Understanding

Actions

This botlet has the following actions:

generic

Input:

Field Name Type Required Description
config $system.lu_request Y An object describing the request and its destination

Output:

Field Name Type Required Description
lu $system.lu_response Y The recognized language elements

Sample Code

Here is a sample code for calling system.languageunderstanding botlet:

# =================================================================
# Consume LUIS model
# Train and deploy the LU model on LUIS portal
# get the AppID and Programmatic Key to call through the LU resolver
# =================================================================

GET_INPUT
SET lu_request = create("$system.lu_request", method="Luis", appid="your AppID", key="your Programmatic Key ", utterance=USER_INPUT)
CALL "system.languageunderstanding", "generic", config=lu_request
SET lu_response = CALL_RESULT.lu
SAY lu_response

# =================================================================
# Consume Pre-built model
# common is the only pre-built model we support for now
# =================================================================

GET_INPUT
SET lu_request = create("$system.lu_request", method="Prebuilt", scope=["common" ], utterance=USER_INPUT)
CALL "system.languageunderstanding", "generic", config=lu_request
SET lu_response = CALL_RESULT.lu
SAY lu_response

# =================================================================
# Consume Composite models
# Train and deploy the LU model on LUIS portal
# get the AppID and Programmatic Key
# Call the model plus prebuilt model through LU resolver
# =================================================================

GET_INPUT
SET lu_request = create("$system.lu_request", method="Combination", scope=["common" ], appid="your AppID", key="your Programmatic Key", utterance=USER_INPUT)
CALL "system.languageunderstanding", "generic", config=lu_request
SET lu_response = CALL_RESULT.lu
SAY lu_response

Custom Language Model Building

Below is a list of supported language model services. LUIS is our current language model service, but in the future, we will be supporting multiple language services.

Language Understanding Intelligence Service (LUIS)

To get started with building your custom language model, you will need to create an account through the LUIS portal. Once you’ve created an account in the LUIS portal and train your custom language model, you can use the APP ID (e.g., 4b74519e-xxx-xxxx-xxxx-xxxxxxxxxx) and Programmatic Key (e.g., 2743xxxxxxxxxxxxxxxxxxxxxx) to call prebuilt botlets system.languageunderstanding to get your model result. This helps you call an API that is under separate Microsoft terms, not part of Microsoft Knowledge Graph Exchange. You are responsible for ensuring your implementation and use complies with all applicable terms of the API.

Prebuilt Models

There is a wide range list of prebuilt models that you can consume directly, or that can be combined with your own custom built models using the prebuilt botlet called “system.languageunderstanding.” For a full list of prebuilt models, see Full List of Prebuilt LU Models