WARNING

Translated, needs to be reviewed

The Natural Language Unit: NLU is composed of several tabs.

When your respondents interact with the chatbot, we analyze the sentences entered by the respondents.

For this we use Machine Learning algorithms. We are able to extract from a sentence

  • 1 intention (or 2 in some very specific cases): this is the main subject of the sentence (buy an apartment, create a ticket, reset a password, ...)
  • entities: these are the objects/precisions that revolve around the main subject of the sentence. For example, in the sentence I want to buy an apartment in Paris. The intention is to buy an apartment and the entity is Paris because that is the city in which the respondent wishes to buy an apartment.

# Intentions

In this part you can create/modify/delete and train your intentions.

The goal is to provide at least 10 phrases per intention so that the algorithm is able to recognize the phrases used by the respondents.

The algorithms work by comparing the phrase entered by the respondent with the set of training phrases, so the more training phrases you have, the better the machine's understanding will be.

Try to follow several "rules":

  • favor different wordings of a similar phrase. If you type 10 sentences that are very similar, it will not have the same performance as 10 sentences with different words and phrases.
  • try within reason to have similar "size" training data between intents. If you have an intention that is trained with 10 times more sentences than another, the algorithm will tend to "favor" the latter.

# For more tips on how to train your NLU you can See the FAQ section

# List of Intentions

At first you have the list of intentions as below List of Intentions

# Expressions linked to an intention

When you set up the NLU of your application, it can be interesting to consult the list of expressions associated with each intention (or each entity).

To do this, in the "NLU" section of the Vizir dashboard, go to the "Intents" tab where you will find the list of intents you have configured for your NLU.

In the box corresponding to the intention of your choice, click on the third button "Linked intentions".

This will open a side panel on the right side of your screen that displays a list of all the expressions you have previously entered that correspond to this intention. This panel is exactly the same as the one that appears when you click on "test the NLU" (present in all sections of the dashboard, on the top right); you can therefore perform the same actions (add/modify entities, add an expression, filter/search expressions, ...)

List of Intent Expressions

This is where you can add the training expressions of your intention.

TIP

Don't forget to tag the entities by clicking on the word or expression as below

Expressions tag entity

DANGER

Try to keep the number of expressions per intention the same for each intention in order to have a powerful NLU.

# Intent Options

You can change the options for each intent by clicking on the first button from the list of your intentions (settings).

You can access the options of the intention. Expressions tag entity

  • save in an attribute: You can use the value of the intention to save it in an attribute. This feature can be useful to know what is the last action your respondent has done since the NLU.

As we can see in the image below, in addition to choosing the intent, we also need to select a "manual" value for the attribute. You can write any value you like, it will be the same for all respondents when the NLU finds this intent. Expressions tag entity

  • Regex Regexes allow you to train certain intents more quickly. For example, in the example below, we'll simply extract all the sentences that start with Hey and assign them to the Hello intention. Expressions tag entity

Of course, this feature can be used for much more advanced use cases.

# Entities

Entities will allow you to:

  • refine logical redirections
  • save information directly without asking the user again

# Refine the logical redirection

Sometimes you may want to have different logics depending on the value of one (or more) entity.s.

For example, you want to allow your users to reset their SAP password but not the Azure password which must follow another procedure.

So we will make a configuration 'reset password' + 'application type' which will be different depending on the value of this one. Here is how we can set this in the configuration tab: Logic Entities

# Save information

Entities can also be used as part of skills actions to not re-request information that the respondent has already entered.

For example: I want to book a train ticket for tomorrow morning from Paris to Marseille

We are able to understand that the user wants to book a train ticket, so we will redirect him to the ticket booking skill.

But we also understand that the date is Tomorrow morning and that the departure and arrival cities are Paris and Marseille.

So we can go directly to the validation resource to validate that the information we have retrieved is correct.

To save the value of an entity in an attribute, we must activate the functionality and enter the name of the corresponding attribute as below: Save an entity

# Entities, synonyms and keywords

The performance in entity extraction will be very much related to Keywords and Synonyms.

  • Keywords: these keywords will "help" the algorithm to find the corresponding entity when it sees one of the keywords in the respondent's sentence.

TIP

It is absolutely necessary that some keywords are also present in the training sentences and "tagging" otherwise they will not be useful.

  • Synonyms will not improve the understanding and extraction of entities. However, they will allow you to improve the configurations. Let's take an example: I want to go to Paname tomorrow morning

The NLU will be able to extract Paname as the name of a city. However, in the configuration we have entity based logic but we did not use Paname but Paris.

If we have added in the configuration of the entity city a synonym Paris: Paname, ville lumière, ... The algorithm will be able to find Paris.

TIP

The values of the synonyms are automatically added to the keywords of the entity

# Save the entity in an attribute

Please note that one of the great uses of being able to detect entities is to keep them in memory => thus to save them in an attribute.

To do this, you have to check the Save in an attribute box and choose the attribute in which to store the entity detected by the bot.

You can then use this value in the conversation or in a workflow interfaced with your IS.

# Regex

Here the logic is the same as for the intentions. If the "keywords" that correspond to the possible values of your entities, you can create Regex rules.

TIP

As for the keywords, you need to add some training sentences with entity values that match the regex in the training sentences.

# Configuration

The configuration will allow you to redirect respondents to a resource or skill based on the intentions and entities we have been able to extract.

This option is available in the Training part of the NLU. Logic entity_priority

We have 2 main choices in the configuration:

  • Favor intent for logic choice
  • Favour the entities for the choice of the logic

Let's take an example: I want to reset my password on SAP We understand:

  • intent: reset password
  • entities: SAP => application-type

# Case 1: Priority to the intention (basic configuration)

We will redirect version of a configuration that has the intention reset password.
If we find only one reset password - 0 entity then we will still use this logic because we believe that the meaning of the sentence has priority (intention first).

# Case 2: Priority to entities (Possible settings in training)

We still have the same configuration reset password - 0 entity.

However if we find a configuration 0 intention - application-type we will give priority to this configuration. (entity first)

TIP

Don't hesitate to ask your project manager the best way to configure your chatbot according to your use case.

It's easier to start with the right configuration than to change it on the fly.

# Other configuration options

For each configuration in addition to the logic you have several options as in the image below: Logic option

  • Context takeover: Context takeover will allow your users to ask questions and return to the same place in the conversation. For more information FAQ here Here is an example of a conversation that can be created with this option Logic Precision

  • Consider as not understood: This option will allow you simply at the statistics level. It allows you to increment the misunderstood and total_misunderstood by 1 even if you have found this configuration.

  • Ask for a precision before the search: Allows you to create conversations like the one below very simply Logic Precision FAQ here

  • Logic depending on the value of the entities: As we can see in the example below, we have a particular logic if the value of the detected entity is SAP.

# For more details you can

FAQ here Logic option

# NLU queries

Find in this section the sentences that have been analyzed by our natural language understanding algorithms.

Select the type of algorithm and you will see the queries from your users that we have processed with this algorithm and what we have understood.

NLU Query Type

  • NLU: Train your chatbot to detect intent and entities in your users' queries
  • Elastic Search: Improve FAQ search by analyzing how our algorithms reacted to a user query.

TIP

The same sentence can be present in both categories because it is highly likely that we have analyzed it with both algorithms.

You will therefore have to archive it twice if you want it to "disappear" from both tabs.

# Analyze the understanding of Elastic Search algorithms

ES query

Here you can find this information at the hover on the closest expression

  • Closest expression detected
  • Associated logic (i.e. resource in which we found this expression)

For the moment, we cannot allow you to add, modify, ... keywords in resources from this view. We are actively working to offer you a new interface in the next few months that will save you time.

# Analyze the understanding of NLU algorithms

In this part, you will be able to find all the sentences that the algorithm has processed from conversations with respondents. Here is what you should see for a bot with users:

NLU query So you get 5 major informations for each request :

  1. The score at the time the request was made (the date appears when the mouse passes over the line in question)
  2. The understood intention
  3. A button to correct the understood intention
  4. A button to archive the query
  5. A button to retest the query => this is very useful to get the new score (since the query can be several months old but your NLU model is only 5 minutes old).

You can also correct a mislabeled entity as explained in this article.

If you ever see when testing the NLU that an entity is not detected, you can use this article to solve your problem.

What to do if your bot does not behave the same for two extremely similar sentences => watch this video

# Test the query with the current training

TIP

The "NLU Queries" tab in the NLU section displays information that are pictures made at the time the query was typed. This means that the information may no longer be valid at the time you view it (in fact, having valid information at the time of viewing would mean re-training the NLU each time the page is viewed; hardly feasible due to the computation time required ⚙️ 🔥 ).

You can nevertheless get this updated information, query by query, by clicking on the dedicated button : "test "

NLU query

On the example here, by clicking on the "test" button of the 4th line, the result will be :

Requete NLU

Here the information differs from what is presented on the line view. For example, the recognized intention is "share my chatbot" whereas on the line view, the recognized intention (at the time the request was typed by a user) was "update...". In the meantime (the moment when the query was typed and the moment when this page is consulted), the NLU had to be re-trained, which explains the "improvement" of the information 👍

# Correcting a misunderstood sentence

To correct a sentence, you can start by adding/removing/editing the entities you want by clicking on the word (or phrase in question). Then, by clicking on correct, you will be able to select the right intention.

Click on Validate (Yes I reassign) and the sentence will then be added to the training sentences for that intention.

Reassign an NLU request ](./images/nlu/requete_nlu_reassign.png)

Here is a video that explains step by step Voir la vidéo (opens new window)

# Chatting

# Training

This is where you can customize your NLU settings. As you can see in the image below, you have 4 options for training and using the NLU NLU settings ](./images/nlu/training_opti_1.png)

# Intent and entity extraction algorithm

If you want to use machine learning to extract an intention and one (or more) entity(ies) from a sentence entered for a respondent, you must enable this option.

This option is active as standard.

You can deactivate it if you want to make a very simple FAQ bot. In this case we will use the FAQ search algorithm

# FAQ search algorithm

If your bot contains FAQ, you must activate this option.

We have 2 use cases where this option is active:

if the NLU intention/entities is activated

In this case, we will first use the NLU. If the NLU redirects us to a FAQ skill, we will search through all the resources to find the most appropriate resource for the respondent's question.

if the NLU intention/entities is not activated

In this case, we will directly search for the most appropriate resource to answer your question. We don't have any information about the skill we need to search in so we will search all the FAQ resources.

TIP

In any case for this to work, do not forget to add keywords in the resources in question see the Resources section

# Using the context

The use of context can be very useful in the case of FAQ.

This option will allow us to create conversations like this one:

Hi, how can I help you?

Looking for help
Create a request

I want to learn how to upload a document on Teams

To upload a document on Teams, ...

And how do I share a document on Teams ?

To share a document on Teams, ...

We realize that the chatbot has kept the Teams context and has simply done a search on the accuracy.

We can also use this functionality for the following use case:

Hi, how can I help you?

Looking for help
Create a request

I want to learn how to upload a document on Teams

To upload a document on Teams, ...

And for Sharepoint ?

To upload a document on Sharepoint, ...

TIP

We recommend enabling this option if you have reasonable FAQ sizes (15-20 resources per FAQ).

# Prioritize entities

The configuration will allow you to redirect respondents to a resource or skill based on the intentions and entities we have been able to extract.

We have 2 main choices in the configuration:

  • Favor the intention for the choice of the logic
  • Favor the entities for the choice of the logic

Let's take an example: I want to reset my password on SAP We understand:

  • intent: reset password
  • entities: SAP => sample application

# Case 1: Intent priority (base configuration)

We are going to redirect version of a configuration that has the intention to reset password.
If we find only one reset password - 0 entity then we will still use this logic because we believe that the meaning of the sentence has priority (intention first).

# Case 2: Priority to entities (Possible setting in training)

We still have the same configuration reset password - 0 entity.

However if we find a configuration 0 intention - application-type we will give priority to this configuration. (entity first)

Here are the two results with exactly the same NLU

TIP

Don't hesitate to ask your project manager the best way to configure your chatbot for your use case.

It's easier to start with the right configuration than to change it along the way.

# Languages and certainty score

You can customize the language of your chatbot. If you want to add a new language, it is possible. We limit the available languages but we can add new languages without any worries.

Because of the algorithms we use, the performance will not be the same in all languages. The availability of open source training data strongly helps the understanding of a language by a machine.

If you are adding multiple languages, you will need one set of data per language. All content will also need to be duplicated per language.

DANGER

Managing several languages on the same chatbot is possible but can quickly become complex. If you need to do this, please contact us and we will advise you on the best way to manage this issue.

Settings of the NLU

# Training optimizations

Finally, we have added a last part that shows possible optimizations for your datasets.

We are listing the main errors that can exist in your training dataset, try to keep this list empty for better performance. NLU settings