Teneo Developers

Matches

Introduction

A Match 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 Matches, 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 types and step-by-step guides on how to add, edit or delete a Match in Teneo Studio.

Types

The following Match 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 positive and negative 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 Matches.

Add, edit or delete a Match

Specifics

Multiple Matches

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 type.

Class

A Class Match 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 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 TLML Syntax Match satisfies 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 based on the provided User Intents, the drafted syntax can be adapted as needed afterwards (in the Match TLML Syntax element, click Advanced Options > Draft).

Entity

An Entity Match 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 while double-clicking allows to create an Entity with the written name.

Learn more

Language Object

The Language Object Match is satisfied 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 while double-clicking allows to create a Language Object with the written name.

Learn more

Script

A Script Match 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 Matches are the slowest among the Match requirements (at evaluation time), so users are encouraged to use them late in the Match chain so their execution is prevented if another Match doesn't match.

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

Context

The Context Match 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; it is possible to add more than one Match Scripted Context to the same trigger/transition.

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.

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.

Learn more