Chatbot intents, granularity & fallback intents

Inhaltsverzeichnis

Über diesen Guide

In the “AI with Kai” section, our Head of AI (aptly named Kai) explores topics in the areas of AI, chatbots and NLP in more detail and presents them in a simple and understandable way.
This article is about
chatbot Intents. What is a chatbot intent? What is so-called intent detection all about? These two questions (and more!) Kai answers. There are also tips for long and happy chatbot relationships, which can be ideally designed using the right granularity and fallback intents. Does it all sound a bit complex? Don't worry, we're now handing over to AI expert Kai, who explains it in a comprehensible and humorous way.

Kai Matzutt, Head of AI:

You probably know that, you have a nice conversation and suddenly a sentence comes up and you ask yourself: “What is that supposed to tell me now?” or simply: “Huh?”
That's how a chatbot feels with every sentence. Fortunately, our favorite discipline, Natural Language Processing (NLP), has long thought about how to deal with the helplessness of our chatbots Can get around.

The branch of NLP that deals with this is called intent detection.

Our chatbot, let's just call her Botilda, is of course an expert, i.e. she is particularly familiar with a number of topics, such as how you can find out the status of the order on a website, or what you need to do if you have forgotten your password. A well-implemented Intent detection This is now the technique that allows her to recognize, in the case of a question or comment from the other person, whether a topic has been addressed that Botilda is familiar with. Just in case, Botilda of course has the right answer. As you've probably already guessed, topics are called in NLP jargon Intents. For this reason, I will use both terms, i.e. topics/intents, in this text.

If you follow this column regularly, then you might also want to become an expert in NLP, which is why I want to tell you a bit more about how such a Intent Detection can be implemented.

Recognition of topics (chatbot intents)

The recognition of topics is still relevant today for optimal, more complex chatbots. Even if you could somehow ask a question to a slightly drilled ChatGPT and the detour of first identifying topics seems absurd. But this firstly deprives yourself of the opportunity to provide answers yourself, especially when it comes to sensitive topics, or to specifically select sources of knowledge. You can read about what can happen if you don't do that elsewhere on our blog.

In the past, when large language models (LLMs) - if they existed at all - were still in their infancy, the recognition of topics was a bit different, something like a general understanding of language, was a dream that was a long way off, so that the “small models” had to be taught special tricks. Today, you can ask LLMs about the topic of a customer request. That sounds much simpler, but it is only limited, because even though the LLM generalizes very well, you have to balance out very precisely which details you have to share with it. So-called prompt engineering, i.e. the formulation of the question to the model, is only intended to recognize the topics that you actually want to answer. And the security of your data is also an important aspect here. We will deal with everything that you can do wrong at elsewhere.

Old World: Sentence embeddings (and float in higher dimensions)

Everyone knows that computers only “think” in 0s and 1s (“binary”). And Botilda is also a computer in a way, so how does she “understand” what we're saying? First of all, we need a way to translate the text for our chatbot in such a way that it can “understand the meaning.” Of course, letters are very easy to translate into 0s and 1s (although in many ways — I'm thinking in particular of the early days of “Unicode”). But the meaning of words or even sentences is far from being understood in binary language.

To do this, we have to think back a bit to your time at school and study, during which you (hopefully!) You've learned something about vectors. Yes, these were the arrows that you could add up to create new arrows. Or you could interpret them as points in a specific space, for example a plane.

Now imagine that you can assign such a vector, a point in a specific space, to any conceivable sentence. In such a way that sentences that are similar in meaning are close together (ideally regardless of language) and that relationships that exist between sentences are somehow “stored” by the spatial relationship of their associated points.

Sounds a bit crazy, but with the help of language models that I already wrote in my first blog post “NLP — examples and potential” I mentioned that is very well done these days.

(I will have to explain what language models are and how to use them to turn sentences into vectors in one of the next blog posts.)

The meaning of a sentence can therefore now be determined at the position; the person skilled in the art also speaks here of embedding the sentence vector in this vector space. However, because language is now quite complex, no layer is sufficient as an “embedding space” or “embedding vector space”, but spaces that have significantly more dimensions than the two of a level have proven effective here. For example, with an embedding that we use from moinAI, we are in a 1000-dimensional space. This is difficult for people to imagine, but the rules that apply in such spaces can be derived quite well from our three everyday dimensions (for know-it-alls: I never feel like I have time, so I didn't mention the fourth dimension that we live with here).

To illustrate: The three dimensions that we humans know. The eleven dimensions (string theory) and the 1000 dimensions of artificial intelligence from moinAI.

And vectors or points are very easy to translate into binary language, so that Botilda can use these vectors to use a first idea of the relationships between sentences/texts.

So that Botilda now also understands the deeper meaning of the various areas of the room, she now needs a few more lessons from good teachers. We'll look at that in the next section.

Classification — which sentence belongs to which topic?

As a next step, we now want to teach Botilda which sentences belong to which topic. In experts, this is called classification or classification in English (by the way, with this technical term, the vectors do not necessarily have to belong to texts) and instead of topics, people actually speak of classes.

The principle behind classic (haha!) Classification algorithms are actually a bit like in school: First, we give Botilda lots of examples of sentences and tell her which topic the respective sentences belong to (these are the so-called training data sets). Then we give her other example sentences and she should tell us which topic she would assign the sentences to (these sentences form the test data set). Depending on how well she did it, she gets grades. However, a more business-related term has prevailed for grades: the “costs” of their assessment are valued using a so-called “cost function.”

Since Botilda is clever, she tries to draw her conclusions from this review and will assign topics a bit differently next time. So we go to the next round and give her the training data again to learn and test Botilda based on the training data. We will now play this game until we are satisfied with the grades or the grades simply do not improve anymore. In the latter case, we may need to obtain additional training examples so that Botilda has a good chance of getting even better.

And do you know what's best about working with us from moinAI? We are such an experienced team of teachers and trainers that there is almost nothing more for you to do. We'll give you a few basic tips at the beginning, then you'll essentially tell us what kind of inquiries you expect with a few examples and then we'll start the training camp. And after a short time, you'll have a ready-to-use AI!

Talk therapy — tips for long happy chatbot relationships

Here I would now like to explain a few of the tips that I have just mentioned.

granularity definition

What is granularity?

It is important for AI chatbots Always the so-called Granularity of intents. In short, it is a question of whether a topic/intent is formulated in a particularly general or particularly specific way.

To illustrate this with simple examples: If you define a topic “Technical problem on the website,” for example, then that is probably a rough granularity (English technical term “coarose granularity”), because this topic could certainly be broken down much more finely, e.g. in the case of a web shop in “Order overview error”, “Order completion does not work”, “App connection problem” and other topics that all They have something to do with the site's technology. If you now present the topics in such detail, you speak of fine granularity (surprise: in English “fine granularity”).

Whether you should opt for a fine or a rough granularity depends somewhat on the target group and your own preferences. One option that works particularly well for us is to first start with a rough topic grid and then the moinAI  Dreaming-Feature uses. This AI-based feature suggests new topics based on the queries that actually reach the chatbot. In this way, you can usually see very quickly whether it is worthwhile to split up a topic. You just have to be careful here that the topics don't overlap too much. Because Botilda wants to give the best answer and that is ideally the one for a very finely selected intent. But even then, you can sit back and let us do the work. Our AI recognizes such problematic cases and our MI (human intelligence — in the form of CSM- and AI experts 😎) solves the problems for you. With KIMI, so to speak.

fallback solution

What is a fallback intent?

After all her academic education, Botilda, as an expert, also knows very well what she doesn't understand. In other words, everything that doesn't fit the topics she has trained is absorbed in a big collective topic. We also like to talk about Fallback intent. Here, it is recommended to have an answer ready that points out what she is familiar with. As experts for expert chatbots, we are of course happy to help you formulate suitable answers.

Relationship between topics and chatbot responses

Of course, in the end, Botilda's goal is to make her interlocutors happy with your answers. Since there is always confusion here, I would like to point out once again that topics/intents and appropriate chatbot answers are of course in a suitable relationship, but their meaning must be considered very differently.

Like the name Intent Detection As already mentioned, we want to understand the meaning of the question here. However, the right chatbot answer is something that has to do with appropriate content for the identified topic and that can differ from context to context. To make it quite banally clear: Our intent detection is multilingual. You can therefore use the same trained topics for all your country-specific websites. But I doubt that your French customers will be satisfied with German-language answers. You can find out how to solve the challenge of multilingualism in terms of chatbot answers in the blog article “Chatbot channels: definition and benefits”.

If you are wondering what a chatbot could look like in your company's customer communication, then I would like to recommend a chatbot demo. This is carried out by one of our consultants and shows all the possibilities of a chatbot in customer communication. Of course, individually for the use case of your choice, free of charge and without obligation.

➡️ Book a demo now

Happier customers through faster answers.

Überzeugen Sie sich selbst und erstellen Sie Ihren eigenen Chatbot. Kostenlos und unverbindlich.