Use TLML Syntax Match
In Teneo, we can use different kinds of Match requirements in our flow triggers. We have already shown some examples of different ones. Now we will show you how to create a TLML Syntax trigger.
Both triggers with TLML Syntax Match and those with Class Match can be built automatically from testing examples. The difference between the two is that with conditions, we have the ability to hand-tailor intent trigger using Teneo's Syntax Condition to either cover a broad use case or a very specific set of words and sentences.
We will now build a new flow for people that are interested in joining the Longberry Baristas' loyalty program, which will have a trigger with a TLML Syntax Match and allow dialogs like the following:
User: How much does it cost to join the loyalty program?
Bot: You can join the loyalty program for free! Just ask your local barista for a club card and you're in!
The final result will look like this:
Create a new flow
Let's start by creating a new flow to cover this intent.
- Navigate to your Flows folder and create a new flow.
- Name the flow
User wants to know if loyalty program is free
.
Populate the trigger
The next step is to populate the trigger to cover the testing examples:
- Navigate to the trigger and name it
Is the loyalty program free?
. - Click on 'edit' and paste the following Intent examples into the field:
Do I need to pay for the rewards program
How much does it cost to join the loyalty program
Is the rewards program free
What is the price of the loyalty program
Create a TLML condition
At this point we can either force Teneo to generate a Match or manually select one we are interested in. Let us start off by manually adding a TLML Syntax Requirement and adding a condition.
- Click on the Plus icon under the trigger and add a Match for 'TLML Syntax'.
- Paste in the following condition:
tlml
1(%WHAT_IS_THE_PRICE_OF.PHR &^ %LOYALTY_PROGRAM.NN.SYN)
2 /
3(%LOYALTY_PROGRAM.NN.SYN &^ %FREE.ADJ.LEX)
4 /
5(%REWARD.NN.LEX &^ %PROGRAM.NN.LEX &^ %FREE.ADJ.LEX)
6 /
7(%SHOULD_I.PHR &^ %PAY_FOR.VB.MUL &^ %REWARD.NN.LEX &^ %PROGRAM.NN.LEX)
8
Here, we can see that Teneo used the Intent examples to find matching language objects and combine them in a language condition. This is human-readable and, if we understand the syntax, it can be fine-tuned to suit our needs. For now, we will just use the condition as is; later, we will see how to further optimize this language condition in order to shorten and increase the coverage of a Syntax condition.
Add an answer
To finish the flow, we need to add an answer text to the output.
- Navigate to the Output node and name it
You can join the loyalty program for free!
. - Click on 'Edit' and paste in the following answer
You can join the loyalty program for free! Just ask your local barista for a club card and you're in!
. - Hit 'Save'.
That's it! We now have a flow that includes a trigger with a TLML Syntax Match.