Use TLML Syntax Match
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:
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.
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
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:
1(%WHAT_IS_THE_PRICE_OF.PHR &^ %LOYALTY_PROGRAM.NN.SYN)
3(%LOYALTY_PROGRAM.NN.SYN &^ %FREE.ADJ.LEX)
5(%REWARD.NN.LEX &^ %PROGRAM.NN.LEX &^ %FREE.ADJ.LEX)
7(%SHOULD_I.PHR &^ %PAY_FOR.VB.MUL &^ %REWARD.NN.LEX &^ %PROGRAM.NN.LEX)
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.
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.