Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
205 lines (158 sloc) 8.13 KB
title titleSuffix description services author ms.custom manager ms.service ms.subservice ms.topic ms.date ms.author
Quickstart: create app - LUIS
Azure Cognitive Services
This quickstart shows how to create a LUIS app that uses the prebuilt domain `HomeAutomation` for turning lights and appliances on and off. This prebuilt domain provides intents, entities, and example utterances for you. When you're finished, you'll have a LUIS endpoint running in the cloud.
cognitive-services
diberry
seodec18
nitinme
cognitive-services
language-understanding
quickstart
12/17/2019
diberry

Quickstart: Use prebuilt Home automation app

In this quickstart, create a LUIS app that uses the prebuilt domain HomeAutomation for turning lights and appliances on and off. This prebuilt domain provides intents, entities, and example utterances for you. When you're finished, you'll have a LUIS endpoint running in the cloud.

[!INCLUDE Sign in to LUIS]

[!INCLUDE Select authoring resource]

Create a new app

You can create and manage your applications on My Apps.

  1. In the LUIS portal, on the My apps list, select + Create.

    In the LUIS portal, on the My apps list, select '+ Create.

  2. In the dialog box, name your application Home Automation then select Done. LUIS creates the app. The description is optional and isn't used for authoring or prediction. The prediction resource is also optional when creating a LUIS app. When you publish your app to production, you should assign a prediction resource so your app can handle many requests.

    In the dialog box, name your application Home Automation

    [!NOTE] The culture cannot be changed once the application is created.

Add prebuilt domain

Select Prebuilt domains then search for HomeAutomation. Select Add domain on the HomeAutomation card.

Select 'Prebuilt domains' then search for 'HomeAutomation'. Select 'Add domain' on the HomeAutomation card.

When the domain is successfully added, the prebuilt domain box displays a Remove domain button.

Intents and entities

Select Intents to review the HomeAutomation domain intents. The prebuilt domain intents have sample utterances.

Screenshot of HomeAutomation intents list

[!NOTE] None is an intent provided by all LUIS apps. You use it to handle utterances that don't correspond to functionality your app provides.

Select the HomeAutomation.TurnOff intent. You can see that the intent contains a list of utterances that are labeled with entities.

Screenshot of HomeAutomation.TurnOff intent

Train the LUIS app

[!INCLUDE LUIS How to Train steps]

Test your app

Once you've trained your app, you can test it. Select Test. Type a test utterance like Turn off the lights into the interactive test pane, and press Enter.

Turn off the lights

Check that the top scoring intent corresponds to the intent you expected for each test utterance.

In this example, Turn off the lights is correctly identified as the top scoring intent of HomeAutomation.TurnOff.

Screenshot of Test panel with utterance highlighted

Select Inspect to review more information about the prediction.

Screenshot of Test panel with inspection information

Select Test again to collapse the test pane.

Publish the app to get the endpoint URL

[!INCLUDE LUIS How to Publish steps]

Query the V3 API prediction endpoint

[!INCLUDE LUIS How to get endpoint first step]

  1. In the browser address bar, for the query string, make sure the following name and value bars are in the URL. If they are not in the query string, add them:

    Name/value pair
    verbose=true
    show-all-intents=true
  2. In the browser address bar, go to the end of the URL and enter turn off the living room light for the query value, then press Enter.

    {
        "query": "turn off the living room light",
        "prediction": {
            "topIntent": "HomeAutomation.TurnOff",
            "intents": {
                "HomeAutomation.TurnOff": {
                    "score": 0.984315455
                },
                "HomeAutomation.QueryState": {
                    "score": 0.009912962
                },
                "HomeAutomation.TurnDown": {
                    "score": 0.00626645749
                },
                "HomeAutomation.TurnUp": {
                    "score": 0.00572059769
                },
                "HomeAutomation.SetDevice": {
                    "score": 0.00379381469
                },
                "HomeAutomation.TurnOn": {
                    "score": 0.00366983772
                },
                "None": {
                    "score": 0.000623856
                }
            },
            "entities": {
                "HomeAutomation.Location": [
                    "living room"
                ],
                "HomeAutomation.DeviceName": [
                    [
                        "living room light"
                    ]
                ],
                "HomeAutomation.DeviceType": [
                    [
                        "light"
                    ]
                ],
                "$instance": {
                    "HomeAutomation.Location": [
                        {
                            "type": "HomeAutomation.Location",
                            "text": "living room",
                            "startIndex": 13,
                            "length": 11,
                            "score": 0.907323956,
                            "modelTypeId": 1,
                            "modelType": "Entity Extractor",
                            "recognitionSources": [
                                "model"
                            ]
                        }
                    ],
                    "HomeAutomation.DeviceName": [
                        {
                            "type": "HomeAutomation.DeviceName",
                            "text": "living room light",
                            "startIndex": 13,
                            "length": 17,
                            "modelTypeId": 5,
                            "modelType": "List Entity Extractor",
                            "recognitionSources": [
                                "model"
                            ]
                        }
                    ],
                    "HomeAutomation.DeviceType": [
                        {
                            "type": "HomeAutomation.DeviceType",
                            "text": "light",
                            "startIndex": 25,
                            "length": 5,
                            "modelTypeId": 5,
                            "modelType": "List Entity Extractor",
                            "recognitionSources": [
                                "model"
                            ]
                        }
                    ]
                }
            }
        }
    }

    Learn more about the V3 prediction endpoint.

Clean up resources

[!INCLUDE LUIS How to clean up resources]

Next steps

You can call the endpoint from code:

[!div class="nextstepaction"] Call a LUIS endpoint using code

You can’t perform that action at this time.