Teneo Developers

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:

final flow layout

Teneo 7.5 introduces a new Flow User Interface in Teneo Studio Web. Images and videos will be updated gradually. Please refer to the Release Notes for a preview of the new look-and-feel.

Create a new flow

Let's start by creating a new flow to cover this intent.

  1. Navigate to your Flows folder and create a new flow.
  2. 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:

  1. Navigate to the trigger and name it Is the loyalty program free?.
  2. 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.

  1. Click on the Plus icon under the trigger and add a Match for 'TLML Syntax'.
  2. 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.

If you are developing using a language without any Language Resources, Teneo will generate a condition using plain words instead of Language Objects.

Add an answer

To finish the flow, we need to add an answer text to the output.

  1. Navigate to the Output node and name it You can join the loyalty program for free!.
  2. 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!.
  3. Hit 'Save'.

That's it! We now have a flow that includes a trigger with a TLML Syntax Match.