In Teneo, you can use two different kinds of triggers in your flows, class triggers and syntax triggers. We have already shown some examples of the former one, and will here show you how to create a syntax trigger.
Both class triggers and syntax triggers can be built automatically from learning examples. The difference is that with syntax triggers, a language condition will be created that can later be manually adjusted. This language condition consists of language objects that are concatenated using Teneo's condition syntax.
We will now build a new flow about Longberry Baristas' loyalty program, which will have a syntax trigger 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:
User wants to know if loyalty program is free.
As you can see the flow contains a syntax trigger instead of a class trigger (if you accidentally created a regular flow with a class trigger, you should add a syntax trigger and remove the class trigger).
Is the loyalty program free?
Is the rewards program free How much does it cost to join the loyalty program What is the price of the loyalty program Do I need to pay for the rewards program
At this point you can either force Teneo to generate a language condition, or you can wait until you save the flow and let Teneo generate it then. Let's force Teneo to generate a condition now:
(%SHOULD_I.PHR &^ %PAY_FOR.VB.MUL &^ %REWARD.NN.LEX &^ %PROGRAM.NN.LEX) / (%WHAT_IS_THE_PRICE_OF.PHR &^ %LOYALTY_PROGRAM.NN.SYN) / (%REWARD.NN.LEX &^ %PROGRAM.NN.LEX &^ %FREE.ADJ.LEX)
As you can see, Teneo used the example inputs to find matching language objects and combine them in a language condition. It is human readable and when you understand the syntax, you can fine-tune it to suit your needs. For now, we'll just use the condition as is, we will later see how we can further optimize this language condition in order to shorten it and increase its coverage.
If you have also created the User wants to reset the password flow, you may have noticed that the language condtions for transitions are generated in a similar way as syntax triggers.
To finish our flow, we need to add an answer text to the output.
You can join the loyalty program for free! Just ask your local barista for a club card and you're in!into the 'Answers' field on the right.
You can join the loyalty program for free!.
That's it! We now have a flow with a syntax trigger instead of a class trigger.
Was this page helpful?