Multi2ConvAI
Blog

"Hey Neo, where can I buy a mask?" -
Intent Classification

All you need to know about how chatbots answer correctly to your requests

23.09.2021

Understanding and answering inputs correctly is a crucial part in every conversation with a virtual assistant. The process of recognizing the goal behind an input in NLP is also known as intent classification. In this article, we want to talk a bit about this task and why this is important for conversational agents.

If you’re building a task-oriented dialogue system (e.g. for booking a hotel or finding the nearby store to buy things), you are interested in getting your Natural Language Understanding (NLU) right. Understanding user requests in natural language is a critical part of a successful conversational experience. You can't address a request properly if the conversational agent doesn’t understand it.

Intent classification is designed for providing an intuitive understanding of the user request. This blogpost will first give a broad overview of what intent classification is, why it is important, and how to design a dataset to train your machine learning model on.


What is an intent classification?

Intent classification is the task of correctly labelling an input in the form of a natural language utterance from a predetermined set of intents. We can treat it as a multiclass classification task, and train a discriminative machine learning model to output a predicted classification for a given utterance [1].


Example: Covid use case in German

Imagine the use case of Covid, where the user wants to buy a mask, and is asking the conversational chatbot where to buy the mask. For an intent classification task, the input will be the user utterance “Wo kann ich mir eine Maske kaufen?” [“Where can I buy a mask?”]. Followed by vectorization as a preprocessing step to map the semantic meaning of the user utterance into a fixed vector, the process continues with the machine learning model classifying the vectorized user utterance with the matched intent. Eventually, the output of the chatbot will be the classified intent (“covid_masks”), which is considered to have the highest probability (i.e. most likely intent based on the user utterance as an input).

“Not all chatbots are created equal”[2]

It is certain that conversational chatbot systems can focus on a single domain and a single language to be as precise as possible [3]. But having a chatbot system that can do more than answering a number of specific questions for a single domain fits more into our daily usage. Multi-lingual as well as multi-domain chatbots extend the capabilities of the previously mentioned simpler conversational chatbot systems through their abilities to handle multiple languages and perform well in a multi-domain setup. Building such a multi-lingual and multi-domain chatbot is one of the project goals of the presented Multi2ConvAI project. The complex setup is better suited for use in the real world, however it requires more effort for the data collection and training process. Therefore, building a conversational chatbot to handle daily assistance is not a trivial case.

Why is the task important?

Correctly classifying the user’s intent, e.g. why a conversation started in the first place, is a key feature for chatbots to succeed in their social and economic environment. Additionally, detecting user intents can be treated as the first step to let the dialogue system understand what the user requests. Furthermore, the system can take precise actions or ask further questions in order to fulfil user needs given a correctly classified user intent.

How can we build a dataset to train ML models for intent classification?

Training a ML model for intent classification requires a certain amount of data where user utterances are paired with the corresponding intents as labels. How extensive this training dataset needs to be, depends on the complexity of the chosen scenario that the chatbot wants to handle. If the task is easy (e.g. single domain, not so many tricky cases), rule-based methods might be enough to handle well with the intent classification task. But if the user scenario is considered with multilingual or multi-domain setup, then a more complex deep learning approach is more suitable.


[1] Charles Costello, Ruixi Lin, Vishwas Mruthyunjaya, Bettina Bolla, and Charles Jankowski. Multi-layer ensembling techniques for multilingual intent classification. CoRR, abs/1806.07914, 2018.

[2] Scott Horn, Why business chatbots must understand customer intent, https://venturebeat.com/2017/03/01/why-business-chatbots-must-understand-customer-intent/, March, 2017

[3] Nikola Mrkšić́, Diarmuid O Séaghdha, Tsung-Hsien Wen, Blaise Thomson, and Steve Young. 2016. Neural belief tracker: Data-driven dialogue state tracking. arXiv preprint arXiv:1606.03777.


About the partners of the project

The consortium of the Multi2ConvAI research project consists of the University of Mannheim and two SMEs based in Karlsruhe, inovex GmbH and Neohelden GmbH. The three partners share their expertise within the project in the hope to learn and grow from the resulting synergies.


Contact

If you have any questions or suggestions, please do not hesitate to contact us at info@multi2conv.ai.



Funding

The project Mehrsprachige und domänenübergreifende Conversational AI is financially supported by the State of Baden-Württemberg as part of the “KI-Innovationswettbewerb” (an AI innovation challenge). The funding aims at overcoming technological hurdles when commercializing artificial intelligence (AI) and helping small and medium-sized enterprises (SMEs) to benefit from the great potential AI holds. With the innovation competition, its specifically promoted cooperation between companies and research institutions and the transfer of research and development from science to business are to be accelerated.