Teneo Developers

Language object variables

Language Objects can have variables too, and if they value of such a variable is the default value _USED_WORDS, the variable will return the words from the user input that matched the Teneo Linguistic Modelling Language condition, making the conversational AI application appear to express some specific knowledge about something that it only understood generally. Language Object variables obtain the particular user input term in the condition of a given Language Object, allowing that term to be used in the corresponding answer.

Imagine, for example a Language object named FOOTBALL_TEAM.LIST with the following condition

tlml

1chelsea / barcelona / everton / liverpool
2

In the Language Object, the Language Object variable lo_teamname is defined. The value of the Language Object variable is _USED_WORDS.

Language Object condition and LO Variable

The default value _USED_WORDS implies that the value will dynamically be set to the matched word(s) in the user input. Of course, this word will have to be in the condition of the Language Object in order to be recognized. However, other values can be used instead.

Then, a Global Variable (or Flow Variable) must be declared, and a listener must be used in order to populate the Global Variable (or Flow Variable) with the value obtained from the Language Object variable.

In this example, sFootballTeam is declared as a Global Variable with the value "" (double quotes).

Global Variable

Also, remember to add a listener to the Flow to be able to populate the Global Variable.

Flow listener

Finally in the Flow, the Global Variable (or Flow Variable) can be used in the answer text, which will display the value obtained by the listener.

Intent Trigger and Output node

When testing the Flow in Try Out, the conversational AI application repeats the mentioned football team, making it seem smarter.

Answer in Try Out

Attached scripts
NLU Variables
NLU Variables in Entities
Listeners and Variables
Create Listeners and Variables
Teneo Linguistic Modelling Language