LUIS Entities

Teneo comes with a collection of pre-built Entities which you may use in your flows. However, sometimes we need to create custom entities for our bot. This works as well on Teneo as it does for LUIS. This is the case for the different kinds of coffee types that are served at Longberry Baristas. In the following section, we will walk you through the creation of this custom entity on LUIS. You can find more information on how to create the same entity on Teneo here.

Create a 'Coffees served' LUIS entity

Let's create the entity for recognizing the different kinds of coffees that are served at Longberry baristas. In LUIS we have different options for how to create this. For this example, we will create a list entity:

  1. Select 'Entities' located on the sidebar to the left under App Assets.
  2. Select 'Create' followed up with 'List'.
  3. Now it is time to name your entity, give it a name like COFFEES_SERVED.
  4. For this option you can select to import the values from this COFFEES_SERVED.json file or manually add values.
Normalized values Synonyms
Americano americano, americanos, americano's, americanos'
Cappuccino cappuccino, cappuccinos, cappuccino's, cappuccinos'
Cortado cortado, cortados, cortado's, cortados'
Espresso espresso, espressos, espresso's, espressos'
Frappuccino frappuccino, frappuccinos, frappuccino's, frappuccinos'
Latte latte, lattes, latte's, lattes'
Lungo lungo, lungos, lungo's, lungos'
Macchiato macchiato, macchiatos, macchiato's, macchiatos'
Ristretto ristretto, ristrettos, ristretto's, ristrettos'
Flat white flat white, flat whites'
Brewed coffee brewed coffee, brewed coffees, filtered coffee, filtered coffees
  1. Once the values have been added, press the 'Train' button located at the top right corner. This will train the intent and score the examples.
  2. Once the training is done press 'Publish' at the top right corner so that Teneo can retrieve it.

The end results should look like this.

Create entity for coffees served

In Try Out, the entity will get a LUIS prefix indicating it is from LUIS and an .ENTITY suffix:

Create an 'Language Objects' folder

Before we create our entities, it might be a good idea to create a folder that we can use to store them. This is not required, but as a solution grows, folders help to structure your Teneo assets. To create the folder, proceed as follows:

  1. Make sure none of the folders on the left are selected, by clicking in the gray area below the folders in the 'Explore' section.
  2. Click the 'Folder' icon in the 'New' group in the ribbon.
  3. Give your folder a name, for example, Language Objects and hit Enter.

Create a Teneo Entity

Now its time to translate the values stores from our previously created LUIS entity inside a Teneo entity.

  1. In your main solution window, select the 'Language Objects' folder and click 'Entity' in the 'New' section of the Ribbon. This will create a new entity in the selected folder.
  2. Call the entity LUIS_COFFEES_SERVED (the type .ENTITY is automatically defined).
  3. Use the left arrow on the top to get to the HOME tab of the entity.
  4. Select the dropdown menu under 'Add Variable' in the 'Variables' section followed up with 'Add Script Variable'.
  5. Name the script variable luisCoffeeType.
  6. Select the entry and copy the following table onto the clipboard followed up with 'First row is variable names'.
Entry luisCoffeeType

The end result should look like this:


Test yourself

Now that we have added an entity that stores coffee types. Let us proceed with adding one more entity but this time for the following coffee sizes:

Normalized values Synonyms
small small
medium medium, regular
large large, big, supersize, venti

What's next?

We have finally created an entity that stores different coffee types. Now its time to use this entity inside a flow and extract the values.

Was this page helpful?