Set up natural language understanding (NLU) for an ITSM chatbot

Learn how to optimize your NLU (natural language understanding) to create a successful ITSM chatbot.

Accrochez vos ceintures ! Ici, vous allez apprendre tout ce qu’il faut savoir sur le paramétrage de la compréhension du langage naturel (en anglais : Natural Language Understanding = NLU). Décollage dans 3, 2, 1…… 🚀🚀🚀

La première chose à savoir, votre bot Vizir peut être paramétré avec deux algorithmes de compréhension du langage naturel : Elastic Search et Intentions/entités. Mon collègue vous l’a un peu détaillé ici.

Pour résumer :

Elastic Search => intelligence mot clé très puissante et efficace

Intentions/entités => reconnaît des intentions et des mots clés (différement de Elastic Search).

Dans cet article, nous allons voire comment paramétrer ces deux algorithmes pour un chatbot ITSM (pour les supports IT).

NLU Intents/Entities setup for an ITSM chatbot

1) The intentions of an itsm chatbot

To properly set up an NLU Intents/Entities, the first thing to do is to create the intents => must be chosen intelligently according to your needs. It is often said that an intention is an action verb. It should also make sense in relation to your categorization in your ITSM tool. In my example, I identified that the essential intentions of future users of this chatbot were:

  • Connect (to the network / to the wifi / to an application / to your remote computer / to the vpn, etc.)
  • Install (an application / software / printer, etc.)
  • Update (an application / software / printer, etc.)
  • Reset (a password for example)
  • Order equipment (a printer, a computer, etc.)
  • Report a hardware problem (paper jam, out of paper, blue screen, etc.)
  • Report the theft of equipment
  • Configure (an app, a workstation, etc.)
  • Declare a newcomer
  • Declare a departure

It’s easy to imagine other intentions your users might have => you have to identify them to add them to the model (often thanks to the analysis of your tickets in your ITSM tool).

To create these intentions, go to the NLU tab> Intents and click “Add Intent”, add them one by one.

add intent nlu

Next, you will need to add training phrases to all of these intents. To do this, click on the “linked expressions” button to the right of the name of your intention.

add training phrases

Then you just need to add sentences 1 by 1 in the text box => they will be added to the list below.

First thing to do here, scroll down the page until you get to the “App Credentials” section and more specifically the “App ID” (it’s kind of your app’s security number , through which Slack can identify the latter). write it down somewhere (in the 21st century you’ll probably want to copy-paste it into a temporary text file 😉 ), you’ll need it later.

train the nlu

Bonus Tips:

  1. In all your intentions, have sentences with basic turns of phrase: “what”, “where” “how to”, etc… => so as not to skew the understanding because of turns of phrase that are only found in a single intention without any particular reason.
  2. Build an “other FAQ” intent to classify phrases that don’t fit into any other category => ideally it must remain as empty as possible, when a false positive is detected, you can requalify the sentence and assign it to this “other” intention. It will be necessary to examine this intention regularly to verify that a new need has not emerged.
  3. Avoid an imbalance in the number of training phrases between your intentions => for example: if an intent A has 90 training sentences and an intent B only 15, your bot will tend to orient its understanding much more towards intent A.
  4. Never train an intention with two identical sentences => simply because it is useless and it would be more difficult for you to find your way through a large number of sentences.

2) Entities for an itsm chatbot

You may have wondered, why are certain words highlighted in my training phrases? That’s thanks to entity detection! To discover and understand what an entity is, go to the “entities” tab next to “intentions”.

add entities

As you can see, we have a base of 9 “natural” entities. For example, the pre-configured entity “Number” will allow your chatbot to detect digits and numbers in user requests. If you write “I have three feet”, the chatbot will associate the word “three” with the entity “Number”.

In your ITSM chatbot case, what will be powerful is being able to detect, for example: applications, materials, workstations, etc.

In my example, I have set up 3 basic entities in particular: Network (wifi, vpn, server, etc..) / Office apps (applications) / Device (printer, pc, smartphone, etc..).

Let’s go into more detail on the “Office apps” entity by clicking on the toothed wheel:

synonym entities

First, note that one of the great uses of being able to detect entities is to keep them in memory => therefore save them in an attribute. To do this, simply check this box and choose the attribute in which to store the entity detected by the bot. Here, I chose to store the detected application in the “tracking” attribute (variable).

Then, to get a chatbot that has variable behavior depending on the detected business application, you need to create synonyms; 1 for each business application. In my example, I have “OneDrive/Teams/Excel”.

Finally, feed each of the synonyms with the keywords you want to associate with it. To do this, ask yourself, for example, “when do I want the bot to understand OneDrive”. If your answer is: “when the user writes OneDrive or Drive”, fill in the synonym “OneDrive” as follows:

keyword entities

At this time, your entity is well configured, all you have to do is tag the words associated with your entities in the training sentences of your intentions. To do this, go back to the “intentions” tab and proceed as in the following video: https://www.loom.com/share/6f4bdfc9bb504effbcb00752bc28af0e . This example is a bit particular since I had already trained the entity OneDrive => so it was automatically detected (and highlighted), so I un-highlighted and then re-highlighted it in the video.

You have therefore well trained your intentions and your entities, now you will have to configure the resources that must be accessed thanks to the NLU understanding of the bot.

3) NLU configuration for an itsm chatbot

To create a configuration, it’s very simple, just click on the “add a configuration” button in the NLU tab> Configuration. Like this !

You can configure your configuration by clicking on the toothed wheel:

nlu logic

It is therefore a question of choosing a logic. In my case, I want when the chatbot understands that this is the “Reset password” intent, it should go to my “Reset Password” procedure.

=> this is the very basic configuration (depending on the detected intent).

You can also parameterize based on the intent AND of an entity. For example I want the intent “Other FAQ” + the entity “office app” to lead by default to ticket creation. I have to configure as follows:

Here, I even added the configuration so that if the “office app” is equal to “Teams”, we access the Teams FAQ, and if the “office app” is equal to “OneDrive”, we access the OneDrive FAQs. This is called logic based on the value of the entity (remember to check the box provided).

The last case that interests us here is the “Ask for clarification before the search” option. In our example, when the chatbot understands the Office app intent without an entity, we want it to ask for clarification on the application to which the user’s request should be associated. Here is the expected behavior:

a) the bot is asked “how to upload a file?” :

b) the bot asks for precision and we choose Teams:

c) the bot answers the question “how to upload a file” in relation to Teams.

To configure this, simply create the configuration of the “other faq” intention without an entity and check the box “ask for clarification before the search”. Finally, you need to redirect the logic to your clarification parameterized resource.

Here is my clarifying resource:

You know everything about setting up the Intents / Entities algorithm! You may have wondered, how well did the chatbot answer the question about Teams? It’s thanks to Elastic Search which operated just after the intents/entities algorithm! So read the next section 😉

WARNING NEW: since September 2020 it is possible to create NLU configurations without intention but just with an entity. We can of course configure this logic with a behavior according to the value of this entity. In the example video, I’m creating configs based on the Spreadable Pate entity and the synonyms Nutella and Chocolata. That is to say that if the chatbot does not understand an intention but locates the entity Spreadable paste, the logic parameterized without intention will be executed, and that is fantastic!

For example, we can have a chatbot that only has logic based on the value of the desktop application entity to make, for example, a FAQ chatbot on your company’s applications.

Setting up Elastic Search

Indeed, Elastic Search is the algorithm that is used for FAQs. In my example, I implemented two official FAQs: Teams and OneDrive. These two FAQs have over a hundred resources (as many as there are documentation articles on the official FAQ).

My intent/entities algorithm allows the chatbot to understand if I have an other FAQ type question and then know if it’s a question about Teams or OneDrive (with or without a request for clarification). Then, ES will determine which of these 221 resources (if we are in the Teams case) should be offered to the user => which answers his question.

This configuration is done using keywords and is therefore done at the level of each resource (you can of course integrate it directly into your setup file as seen previously in the training). Go to the configuration of the “understanding” of the resource. In my example, I’m on the “Leave a team” resource, so I added the “leave team” keyword using the input bar.

That’s absolutely all there is to Elastic Search!!

For example :

I can do :

Training Resource a=”leave Team”

Training Resource b = “leave Group”

Because it is not the same group of keywords. If the user writes “leave Team” the bot will go to the resource has. If the user writes “leave Group”, the bot will go to the resource b.

I can not do :

Training Resource a = “leave”; “Team” (two separate lines)

Training Resource b = “leave”; “”Group” (two separate lines)

Because both resources would be trained with the word “leave” regardless of the rest, so the bot could not choose between resource a or b if the user writes “leave”.

There you go, you know how to configure an NLU for your ITSM chatbot!

Go further

To go even further, here are some more advanced concepts that will help you better control the conversational flow of the bot!

🙏 Pré-Requis

🍔 Menu

To know all about the  chatbots and AI, subscribe to the Newsletter

You seem to like what you read...

Why not subscribe to our newsletter?

Receive this type of content and many others (tools, news, testimonials, podcasts…) every week directly to the mailbox of your choice. Unsubscribe at any time.