Teneo comes with a collection of pre-built Entities that you may use in your flows. However, sometimes we may need to create custom entities for our bot. For example, this is the case for coffee sizes and different kinds of coffee types that are served at Longberry Baristas. We will in the following walk you through the creation of these two.
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:
Language Objects
and hit Enter.Let's create the entity for coffee sizes. In Teneo, an entity can either contain words, phrases or language objects. For simplicity, we start with words here. Moreover, we add a variable called size which can be used to map different names of the same size to the same internal representation. For example, both "medium" and "regular" will result in a "medium" sized coffee at Longberry Baristas.
This is how we go about:
COFFEE_SIZES
(the type .ENTITY is automatically defined).Copy the following table onto the clipboard:
Coffee size | coffeeSize |
---|---|
small | small |
medium | medium |
regular | medium |
large | large |
big | large |
supersize | large |
Now that we have the coffee sizes in place, it is time to add an entity to recognize the different kinds of coffees that are served at Longberry Baristas. In addition to words, this entity will also contain phrases and language objects. The usage of language objects ensures a broader coverage with respect to plural forms, declinations and synonyms of the words. For example, %AMERICANO.NN.LEX will not only recognize "Americano", but also the plural form "Americanos".
Let's go ahead an create the entity:
COFFEES_SERVED
(the type .ENTITY is automatically defined).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 |
Note that filter coffee and brewed coffee are considered synonyms and both should return the type 'brewed coffee'.
Hit 'Save' and close the entity window.
Was this page helpful?