Intent triggers

The main role of an intent trigger is to tell Teneo what kind of inputs, or intents, should activate a flow. There are two types of intent triggers in Teneo: class triggers and syntax triggers.


Class Triggers

Class triggers (or Machine Learning Class Intent Triggers if you want to use the more official name) use a machine learning model (a classifier) to determine what an input is about. You train a class trigger by providing training phrases (called 'learning examples' in Teneo) that are as close to real user inputs as possible.

Ideally you would use actual user inputs, but to get started during development you can just use some example inputs that you can think of from the top of your head. We recommend to start with 10-20 example inputs per class trigger. This will result in good performance, but you will notice the model will improve when you add more examples once you start testing and collect more inputs. You can find more details on improving your learning examples here: Optimization of class triggers.

Note that you can also add negative example inputs. Those are not used to train the model however, but they can be helpful when running automated tests.

Syntax Triggers

Syntax triggers (officially called Language Condition Syntax Intent Triggers) use a different method to find out what kind of inputs should activate a flow. They make use of a language condition, which is expressed using a condition syntax. You can either hand-craft the condition yourself, or let Teneo automatically create it for you from a set of examples, after which you can edit the condition. For an example of different ways to create and edit a language condition, go here: How to create a syntax trigger.

The possibility to use both class and syntax triggers provides you with the power of machine learning and the precision of condition syntax. This is what we call our hybrid model. It is explained in depth in the Language Understanding section.

Linking triggers

Class triggers can be linked to syntax triggers. By linking them, the example inputs of the syntax trigger are also used as training phrases for the class trigger.

Which trigger should I use?

The easiest way to get started with Teneo is by using class triggers. Once your solution grows you may find a need for syntax triggers. For example, if class triggers have trouble distinguishing between two intents. Or if you need to recognize a very specific pattern. Or perhaps your trigger should include certain specific words, in which case a syntax trigger may be best. You can mix and match triggers, depending on your needs. For more details on how to make the best of both types of triggers, see: hybrid approach in the language understanding section.

Context restriction

You can restrict your trigger to only fire in certain contexts, for instance after a certain topic has already been introduced. Consider the following dialog:

User: What is the weather like in Amsterdam?
Bot: It's quite sunny in Amsterdam at the moment, make sure to wear sunscreen!

User: What about Barcelona?
Bot: It's raining in Barcelona. Don't forget your umbrella!

The user's second question can only be interpreted correctly if you know that the topic the user talks about is weather. For this you could create a trigger that fires on inputs like 'What about [city]', but only when the conversation was already about weather. This is what Context restrictions can be used for. Throughout the conversation 'contexts' can be set, which can then be used by triggers as restrictions.

Context restrictions can be added to a trigger in the 'Examples' panel. When an input matches a trigger and the assigned context is true, the trigger will fire. The contexts that you assign may be of different kinds. Often it is confined to the value of a variable that has been set earlier on in the dialog. If the context is hard to represent by means of a single variable value, you can set up a scripted context restriction. As an alternative, you can include Groovy code in the language condition of a syntax trigger.

Order group

When Teneo tests a user input against your solution's triggers, it does so in a certain order, and stops at the first match that fully satisfies all criteria.

Each trigger belongs to an order group. The triggers of the highest ranked order group will be tested before Teneo moves on to the next order group, and so on. Class triggers all belong to the same group called 'Class Triggers'. Syntax triggers can be added to any order group, and you can create as many groups as you like and order them according to your needs. Typically you'll add the most specific syntax triggers to the highest order group, and a more generic syntax trigger to a lower ranking group.

Inside each order group, the ordering may be further refined, so that the order between individual syntax triggers is specified.

When a syntax trigger is born, it will be stored in the default trigger order group. You can easily change that in the drop-down 'Order Group', in the syntax trigger's 'Examples' panel.

Multiple triggers

Flows can have several independent triggers. Using multiple flow triggers makes it possible to create diverse triggers with different degrees of complexity and specificity linking to the same flow. For example, it is possible to create a flow with a class trigger and also a syntax trigger with a more complex condition that matches very precise inputs. These triggers can have their own listeners (to extract additional information from the input) and, in case of syntax triggers, would have their own ordering.

Was this page helpful?