Using Composite Entities In LUIS API For Microsoft Cognitive Services

Introduction

This article will help you understand and work with Composite Entities on LUIS (Language Understanding Intelligent System) API for Microsoft Cognitive Services.

Note - Go through my previous article to understand the Microsoft Cognitive Services and LUIS API, in details. Click here to access it.

Pre-requisites

  • An updated web browser.
  • Microsoft Account (Outlook/ Hotmail/ live ID).

Composite Entities

Composite Entities allow us to define the relationship between entities, that depend on their relative patterns. This works with a set of existing entities. A Composite Entity and its children will not share their common characteristics. It helps LUIS to identify the entities in the group as well as individually too.

Follow the below steps to add a Composite Entity on LUIS API.

Note- I created a LUIS Application by the time of my previous article. So, we will be working on the same, to create Composite Entities if you don’t have an application to create a new one.

Step 1 - Login to www.luis.ai using your Microsoft Account. (If you have already created an application using Microsoft account, then use the same). We will get the below screen. Here, we can find the application that we have created earlier.



Now, let's click on the “Edit” button on the NewsChat pane.



Below is the Edit Panel page of our application.



Step 2 - Let's create an Entity now. Click on “+” sign near the Entities panel.



Name the Entity as “News”, check in with the Include Children button followed by Composite button.

Now, add two Entity Children by clicking on the “+” button near Entity Children. Declare the Children Entities with “Date::StartDate” and another one with “Date::EndDate”, Click on Save once it is done.
 
The trash button near each children entity allows us to delete it.



And now, you can see that the Entity has been added.



Step 3 - Let's label the Composite Entities now. We know that the Composite Entities can work either individually or even with Combined Entities, and now we will be labeling it. Let's create a new Utterance now as “Search news about India for 2 days”.



Select two days and label it as Date. Click on Submit.
 

That's it. 

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now