8 Steps to Combining NLP and NLU for a More Resilient Chatbot
In-depth discussion
Technical
0 0 1
The article argues that most chatbots lack conversational resilience, especially with multilingual input, long compound utterances, and complex entities. It proposes adding a high-pass NLP pre-processing layer before the NLU layer. The eight steps are: automatic language detection, grammar correction, sentence boundary detection, named entity extraction, parsing unstructured data (tables and classification), dependency determination, cleaning markup from text, and tokenization/keyword extraction. Demonstrations use OpenAI GPT-3, spaCy, and NVIDIA Riva. The author concludes that conversational interfaces require additional layers of guidance rather than being complete out of the box.
main points
unique insights
practical applications
key topics
key insights
learning outcomes
• main points
1
Clearly identifies a real, practical problem (lack of chatbot resilience with long, multilingual, or compound input) and frames a concrete architectural remedy
2
Provides a logical, sequential pipeline of eight preprocessing steps that can be adopted incrementally
3
Includes concrete library references (spaCy, OpenAI GPT-3, NVIDIA Riva) and illustrative examples such as entity extraction and dependency parsing
• unique insights
1
A chatbot does not need to identify every language in the world; it only needs to determine whether input falls outside the supported languages, and can then guide the user
2
Sentence boundary detection allows long multi-intent input to be handled per sentence, and can prompt users to restate a compound utterance concisely when the gist is lost
• practical applications
Gives practitioners a reusable preprocessing blueprint to make existing NLU-based chatbots more robust to messy real-world input, with pointers to specific tools for each stage.
• key topics
1
Conversational resilience in chatbots
2
NLP pre-processing layer before NLU
3
Named entity recognition and dependency parsing with spaCy
• key insights
1
Proposes an architectural layer that improves existing chatbots without replacing their NLU framework
2
Combines multiple NLP techniques (language detection, grammar correction, sentence segmentation, NER, parsing) into one coherent workflow
3
Shows how generative LLM APIs (GPT-3) can complement traditional NLP tools for tasks like keyword extraction and table parsing
• learning outcomes
1
Understand why a pre-processing NLP layer can improve chatbot resilience to long, multilingual, or compound user input
2
Apply spaCy for sentence boundary detection, named entity extraction, and dependency analysis as chatbot preprocessing steps
3
Recognize how generative APIs such as GPT-3 can supplement traditional NLP pipelines for classification and keyword extraction
Most chatbot interfaces struggle to stay resilient when users write in multiple languages or submit long, compound messages. Even when capabilities such as language detection exist, they are often not implemented. Long user inputs containing several intents and entities also overwhelm typical natural language understanding (NLU) pipelines, which leads to repeated 'I do not understand' responses and user frustration.
“ A High-Pass NLP Layer: A Different Approach
The proposed solution is to introduce a first, high-pass Natural Language Processing layer that analyzes and pre-processes the user's text before it reaches the chatbot's NLU layer. Much like humans who take a complex question top-down and address each aspect in turn, this layer makes long, compound utterances digestible so the chatbot can respond to each part appropriately.
“ Step 1: Automatic Language Detection
Chatbots typically support only a limited set of languages. Automatic language detection allows the system to determine that the user is not writing in a supported language and to inform them which languages are available. Full identification of every language is unnecessary; the key is recognizing when the input falls outside the supported set. Detection works even for smaller languages, making this an accessible first step.
“ Step 2: Grammar Correction
When intents and entities cannot be detected, the utterance can be passed through grammar and spelling correction APIs, such as those built on GPT-3. These corrections often make malformed sentences far more interpretable, giving the chatbot a second chance to understand the user's meaning.
“ Step 3: Sentence Boundary Detection
Splitting input into sentences, for example with spaCy, enables the chatbot to parse and respond to each sentence separately. The number of sentences gives a loose indication of input size and the number of possible intents. Irrelevant sentences can be ignored, while those with strong intent and entity matches receive focused attention.
“ Step 4: Finding Named Entities
Entities are the nouns in user input, such as locations, dates, brands, and products, while intents are the actions the user wants to perform. Recognizing entities allows the chatbot to craft targeted responses. For instance, a weather forecast requires a location and date. Using spaCy or NVIDIA Riva, named entities such as people, organizations, and places can be detected and labeled automatically.
“ Step 5: Parsing Unstructured Data
Long-form text can be converted into structured tables by specifying a format and supplying examples. Items can also be classified into categories from example inputs, and new entities can be automatically classified with limited training data. This turns unstructured user input into information the chatbot can act upon.
“ Step 6: Determining Dependencies
Word meaning depends on how words relate within a sentence, so word order and grammatical roles matter. Using spaCy noun chunks and dependency labels such as nominal subject (NSUBJ), direct object (DOBJ), and object of preposition (POBJ), the layer can determine how elements of a sentence connect, clarifying meaning beyond individual words and parts of speech.
“ Step 7: Cleaning Text From Markup
Raw user text may contain HTML or other markup. Python packages can strip these tags, transform raw text into readable form, and extract metadata such as word counts and named entities, ensuring the NLU layer receives clean input.
“ Step 8: Tokenization and Keyword Extraction
Tokenization splits text into meaningful segments called tokens. Keyword extraction, which can be tuned to be conservative or more generative, condenses text into key themes. This is valuable for categorization and building search indexes, as demonstrated by reducing a long Wikipedia paragraph on soccer to a handful of keywords.
“ Conclusion: Guiding the Conversation Forward
There is no single remedy for making an interface truly conversational, and it requires time and effort. Commercial chatbot platforms should not be treated as closed frameworks; additional layers can inform the user and strengthen basic NLU. A chatbot should be viewed as a conversational AI interface whose goal is to advance the dialogue and guide users. Without such guidance, users are likely to abandon the conversation.
We use cookies that are essential for our site to work. To improve our site, we would like to use additional cookies to help us understand how visitors use it, measure traffic to our site from social media platforms and to personalise your experience. Some of the cookies that we use are provided by third parties. To accept all cookies click ‘Accept’. To reject all optional cookies click ‘Reject’.
Comment(0)