Skip to main content

Test widget

The NLU test widget allows testing the recognition of intents and entities in phrases. To launch the test widget, navigate to NLU → Intents or NLU → Entities, then click Test in the bottom right corner. Enter the phrase you want to test and press Enter.

tip
The widget displays the results of testing both intents and entities, regardless of where it is launched from.
Testing a phrase

Intents

The testing output shows the list of all intents recognized in the phrase. Each intent corresponds to a score value from 0 to 1 — the level of confidence NLU has that the phrase is matched by it.

info
  • If there are patterns among the intent training phrases, the score is calculated independently for phrases and patterns, and then whichever is the highest is selected.

  • If you use pattern weight modification using the $weight element, an intent score can turn out to be greater than 1.

If a request sent to the bot matches several intents, only one of them is triggered in the script. By default, this is the intent with the highest score.

tip
You can override the triggered intent selection algorithm if necessary: use $context.nBest and the selectNLUResult handler to do this.

Slots

Intents can contain slots — entities which must be mentioned in the user request so that the intent can be fully recognized. The process of clarifying these entities is called slot filling.

If an intent which contains slots is recognized in the test input, a  icon appears next to this intent. Clicking on it expands the list of all extracted slots and the corresponding entity values.

Classification rules

Any intent can be assigned classification rules — extra conditions under which it can be recognized. For each recognized intent, the test widget shows whether the rules are configured, and if so, whether they are fulfilled:

No rules are configuredRules are not fulfilledRules are fulfilled

Select the icon showing the rule fulfillment result to see in detail which rules are fulfilled and which of them are not. The intent will be recognized in the dialog only when all rules are fulfilled.

Classification rule fulfillment results

Training phrase alignment

The triggered intents can also have a  icon next to them. It opens a word-by-word alignment of the request phrase to the intent training phrase which matches it most closely. Knowing this can help better understand why a particular intent was triggered.

caution
Inspecting phrase alignment is only available when the STS classifier algorithm is selected in the project settings and only for intents triggered by a phrase (not by a pattern).
Aligning the request to a training phrase

Select a word in a phrase to view the results of its processing:

  • norm — normalized word representation.
  • lemma — the dictionary form of the word (lemma).
  • weight — word weight.
  • POS — part of speech.
  • punct — whether the word is a punctuation mark.
  • pattern — whether the word is a pattern.
  • type — the type of the rule used for alignment.
  • inSeqNum — the number of the alignment in the sequence. If two words in a row are aligned, then this value equals 2, etc.
  • input aligned weight — it is calculated as the product of the word weight, the sequence weight and the alignment type weight.

Entities

The testing output shows the list of all entities recognized in the phrase. Each entity has a string or a JSON value representing the data contained by the entity. System entities have a predetermined data format, but for your own entities, you can configure the reference data yourself.

tip
If the recognized entity has no reference data, its value is the word sequence in the original phrase from which it was extracted.