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:
- While in the main solution view, make sure the solution root folder in the Explore section is selected.
- Click on the Folder icon in the ribbon bar to create a new folder.
- 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:
- Make sure the newly created 'Language Objects' folder is selected.
- Click on the Entity icon in the ribbon bar.
- A new window will open. Name the entity
COFFEES_SERVED
(the type .ENTITY is automatically defined). - Click on the back arrow to go to the Home tab of the Entity, where you will be able to edit it.
- Copy the following table onto the clipboard:
Coffee name | coffeeType |
---|---|
%AMERICANO.NN.LEX | americano |
%CAPPUCCINO.NN.LEX | cappuccino |
%CORTADO.NN.LEX | cortado |
%ESPRESSO.NN.LEX | espresso |
%FRAPPUCCINO.NN.LEX | frappuccino |
%LATTE.NN.LEX | latte |
%LUNGO.NN.LEX | lungo |
%MACCHIATO.NN.LEX | macchiato |
%RISTRETTO.NN.LEX | ristretto |
flat white | flat white |
flat whites | flat white |
brewed coffee | brewed coffee |
brewed coffees | brewed coffee |
filtered coffee | brewed coffee |
filtered coffees | brewed coffee |
- Inside the Entity, select the cell marked 'Click here to add a new entry'.
- Paste the table you copied earlier.
- 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'. If you experience unexpected behavior in this step try copying the table by highlighting it rather than using the 'copy' button.
- 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.
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.
- 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.
- Select the number of entries you wish to generate and click on 'Generate'. Review the generated examples and click 'Apply' to add them to the list of existing entries.
The newly generated entries will be distinguished from the old ones with yellow highlighting.
Make sure to evaluate that the generated entries are aligned with the scope of your entity. If generating Language Objects, you may need to create the referenced Language Object for the entity entry to be valid.
You also need to populate the string variable column 'coffeeType'. Your entity should now look something like this:
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.