Create your first LUIS app

This article shows you how to create a LUIS app that uses the HomeAutomation prebuilt domain. The prebuilt domain provides intents and entities for a home automation system for turning lights and appliances on and off. When you're finished, you'll have a LUIS endpoint running in the cloud.

Prerequisites

  • To use Microsoft Cognitive Service APIs, you first need to create a Cognitive Services API account in the Azure portal.
  • If you don't have an Azure subscription, create a free account before you begin.
  • For this article, you also need a LUIS.ai account in order to author your LUIS application.

Create a new app

You can create and manage your applications on My Apps page of Luis.ai.

  1. Click Create new app.

  2. In the dialog box, name your application "Home Automation".

    A new app form

  3. Choose your application culture (for this Home Automation app, choose English), and then click Done.

    Note

    The culture cannot be changed once the application is created.

LUIS creates the Home Automation app.

Add prebuilt domain

Click on Prebuilt domains in the left-side navigation pane. Then search for "Home". Click on Add domain.

Home Automation domain called out in prebuilt domain menu

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

Home Automation domain called out in prebuilt domain menu

Intents and entities

Click on Intents in the left-side navigation pane to review the HomeAutomation domain intents.

Home Automation domain prompt

Each intent has sample utterances.

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.

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

Home Automation domain prompt

Train your app

Click on Train in the top navigation.

Home Automation test

Test your app

Once you've trained your app, you can test it. Click Test in the top navigation. Type a test utterance like "Turn off the lights" into the Interactive Testing 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."

Home Automation test

Click Test again to collapse the test pane.

Publish your app

Select Publish from the top navigation.

Home Automation test

Click Publish to production slot.

The green notification bar at the top indicates the app successfully published.

Publish success

After you've successfully published, you can use the endpoint URL displayed in the Publish app page.

Endpoint url

Use your app

You can test your published endpoint in a browser using the generated URL. Open this URL in your browser, set the URL parameter "&q" to your test query. For example, add turn off the living room light to the end of your URL, and then press Enter. The browser displays the JSON response of your HTTP endpoint.

JSON result detects the intent TurnOff

Next steps

You can call the endpoint from code: