Teneo Developers

Match Requirements

Match

A Match requirement is a criterion for matching a user input and can be defined both on triggers and conditional transitions; each trigger/transition can have one or more Match requirements, of the same type or of different types with the only exception being Classes, where only one is allowed per trigger/transition.
This page provides information about the various Match requirement types and step-by-step guides on how to add, edit or delete a Match in Teneo Studio.

Types

The following Match requirement types are available in Teneo Studio:

  • Class
  • TLML Syntax
  • Entity
  • Language Object
  • Script
  • Context, which covers the following three sub-types:
    • Scripted Context
    • Flow Variable
    • Global Variable

Read more in the Specifics section further below.

Generate

When examples of User Intent are added to a trigger or transition, the option to Generate a draft implementation becomes available; this allows to have Teneo generate a draft of the Match implementation based on the available User Intents. The user can, of course, always edit or remove the draft or even add further match requirements.

Add, edit or delete a Match

Specifics

Multiple Match requirements

Each trigger and transition can contain as many Match requirements as needed; although only one Class is allowed per trigger/transition.

The matching process

For each user input, the list of Matches is checked top-to-bottom, executing each match requirement against the user input.
If all Match requirements match, the trigger or transition is considered to trigger for the user input, so the following nodes in the Flow will be executed.
If any of the Match requirements does not match, the rest of the list is left unevaluated.

Below follows more details on each Match requirement type.

Class

A Class Match requirement matches whenever the user input is classified with the selected class as the TOP_INTENT. Since the Machine Learning model selects a single TOP_INTENT class for each input, only one Class Match requirement can be defined per trigger/transition.

To define the class, in the Match Class element, simply write the name of the Class which should be used to match.
In Teneo Studio Desktop, when writing the name of an unexisting Class, it is possible to press Ctrl + double-click to open the Class Manager and create the new Class with the specified name.

Learn more

TLML Syntax

The Syntax Match requirement matches inputs based on a syntactic condition written in Teneo Linguistic Modeling Language (TLML).
The syntax is written manually in the Syntax editor; in Teneo Studio Desktop the developer can draft a syntax condition based on the provided Example Intents which can be adapted or expanded as needed afterwards (in the Match TLML Syntax element, click Advanced Options > Draft).

Entity

An Entity Match requirement matches when the selected Entity is present in the user input.

To define the Entity, in the Match Entity element simply write the name of the desired Entity.
In Teneo Studio Desktop, when writing the name of an unexisting Entity, pressing Ctrl + double-clicking allows to create an Entity with the written name.

Learn more

Language Object

The Language Object Match requirement is matched if the syntax of the selected Language Object matches the user input.

To define the Language Object, in the Match Language Object element simply write the name of the desired Language Object.
In Teneo Studio Desktop, when writing the name of an unexisting Language Object, pressing Ctrl + double-clicking allows to create a Language Object with the written name.

Learn more

Script

A Script Match requirement matches if the script returns a value that can be interpreted as a True Boolean value; in Teneo Studio, scripts are written in Groovy.
Script Match requirements are the slowest among Match requirements (at evaluation time), so users are encouraged to use them late in the Match requirement chain so their execution is prevented if another Match requirement doesn't match.

To define a script, in the Match Script element, simply write the evaluation script (in Groovy).

Context

The Context Match requirement groups different context conditions that can be matched for an input: Global and Flow Variables and Scripted Contexts.

To define a context, simply write the evaluation script or select the state(s) - depending on the type of Context Match selected.

Scripted Context

A Scripted Context matches whenever the evaluated Scripted Context is one of the selected states.

Learn more

Flow Variable

A Flow Variable Context matches whenever the value of the selected Flow Variable matches the return value of the expression (evaluation script) in the Match requirement.

Global Variable

A Global Variable Context matches whenever the value of the selected Global Variable matches the return value of the expression (evaluation script) in the Match requirement.

Learn more