Teneo Developers

Getting started

Teneo comes with a collection of pre-built Entities that you may use in your flows. However, sometimes we need to create custom entities for our bot. 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.

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. While in the main solution view, make sure the solution root folder in the Explore section is selected.
  2. Click on the Folder icon in the ribbon bar to create a new folder.
  3. Give the folder a name, such as Language Objects, either by double clicking the name or clicking on the Rename icon in the ribbon bar.

Create a 'Coffees served' entity

Let's create the entity for recognizing the different kinds of coffees that are served at Longberry baristas. In Teneo, an entity can either contain words, phrases or language objects. Generally speaking, language objects are usually lists of synonyms or thematically related words, which are used to recognize the wide variety of user inputs. This means that language objects ensure a broader coverage, including the plural forms, declinations, and synonyms of the words compared to just using words or phrases. In other words, we do not have to specify every form or synonym of a word to get great coverage. For example, the language object '%AMERICANO.NN.LEX' will not only recognize "Americano", but also the plural form "Americanos".

The entity that we are creating in this section will contain both language objects and words like brewed coffee (singular) and brewed coffees (plural). Since no language object covers the different forms of ‘brewed coffee’ we have to specify them ourselves in the entity. It would be a good idea to create a language object that covers both singular and plural forms of ‘brewed coffee’, and then use that language object as an entry in the entity instead. However, we will skip this step for now...

This is how we will go about it:

  1. Make sure the newly created 'Language Objects' folder is selected.
  2. Click on the Entity icon in the ribbon bar.
  3. A new window will open. Name the entity COFFEES_SERVED (the type .ENTITY is automatically defined).
  4. Click on the back arrow to go to the Home tab of the Entity, where you will be able to edit it.
  5. Copy the following table onto the clipboard:
Coffee namecoffeeType
%AMERICANO.NN.LEXamericano
%CAPPUCCINO.NN.LEXcappuccino
%CORTADO.NN.LEXcortado
%ESPRESSO.NN.LEXespresso
%FRAPPUCCINO.NN.LEXfrappuccino
%LATTE.NN.LEXlatte
%LUNGO.NN.LEXlungo
%MACCHIATO.NN.LEXmacchiato
%RISTRETTO.NN.LEXristretto
flat whiteflat white
flat whitesflat white
brewed coffeebrewed coffee
brewed coffeesbrewed coffee
filtered coffeebrewed coffee
filtered coffeesbrewed coffee

Note that filter coffee and brewed coffee are considered synonyms and both should return the type 'brewed coffee'.

  1. Inside the Entity, select the cell marked 'Click here to add a new entry'.
  2. Paste the table you copied earlier.
  3. You will now be prompted to say whether the data you pasted includes a row of headers or consists purely of data. In our case, the first row consists of headers, so select 'First row is variable names'.
  4. Hit 'Save'.

As you can see the entity structure is similar to a spreadsheet as it contains columns and rows. The left column contains entry values like language objects and words. In the right column, we have the variable 'coffeeType' which contains the string value of the entry on the corresponding row. For example, if we recognize 'americano' the variable 'coffeeType' would get the value "americano". You will learn more about how to extract data from user input on the next page.

The language objects used in the entity above are of the type lexical entries, which are the smallest building blocks from which more complex language objects can be built. All language objects have a suffix that denotes which type it is. On this page, we have worked with lexical entries which have the suffix ‘.LEX’. Language objects of the type lexical entries usually contain different inflections, regional variations, and spelling of a word.

Generate Entity entries

Teneo's copilot features allow you to quickly generate more entries for entities. Let's try that now to expand the entity.

In order to enable copilot features, make sure to first define settings to use Generative AI.

  1. Click on 'Generate Entry'.

As we already have existing entries, let's generate more based on those. If you prefer, you could also generate entries based on a description which you would need to enter at this step.

  1. Select the number of entries you wish to generate and click on 'Generate', followed by 'Yes'.

The newly generated entries will be distinguished from the old ones with yellow highlighting.

Make sure to evaluate the generated entries. If generating Language Objects, you may need to create the referenced Language Object for the entity entry to be valid. For example, let's add one for the invalid Language Object reference to AFFOGATO.NN.LEX:

  1. Navigate to Language Objects and add a new Language Object.
  2. Give it the name AFFOGATO.NN.LEX.
  3. Add the TLML Syntax affogato.
  4. Hit 'Save'.

Repeat the process for other invalid LO references, COFFEES_SERVED.ENTITY and populate the string variable column 'coffeeType'. Your entity should now look something like this:

finished entity

Summary

Great job! You have just created your first custom entity and worked with these components:

  • Folder: Helps you keep your solution organized,
  • Entity: A way of structuring data and mapping entry values to variables that can be used for data extraction,
  • Language objects: Used to get broader coverage for plural forms, declinations, and synonyms of words so the bot can recognize a wide variety of user input.
Next page
Extract Entities
Was this page helpful?