Skip to content

Natural Language Understanding(NLU)

The layer that turns a customer's free text into structured meaning — language, intent, entities and sentiment — that a bot or routing rule can act on.

Also called: Natural language understanding pipeline · Intent and entity detection

Reviewed

Interactive lab

Hands on: use the controls to explore. Anything that plays on its own pauses while you are working inside it.

Drop a Hinglish message through the NLU stack

7 / 7

Payloadorder 48213 kab aayega? 😡

Enters at the top, travels down through 7 layers

One real-shaped WhatsApp message descends through each NLU layer, picking up structure on the way: language, intent, entities and sentiment, then a decision. Tap any layer to jump to it.

Hop 7 of 7: the payload is in layer 7, Structured result. { intent, entities, language, sentiment } goes to the dialogue manager, which looks up order 48213 and replies in Hinglish with the ETA and an agent button.

01What is natural language understanding (NLU)?

Natural language understanding (NLU) is the part of natural language processing that turns what a customer typed into structured meaning a program can act on. Given "order 48213 abhi tak nahi aaya, kal tak aayega? 😡", an NLU layer returns something like: language Hindi in Latin script, intent delivery_status with confidence 0.91, entity order_id = 48213, a date reference to resolve, and negative sentiment. Code — not a human — can then pick the order-status journey, look up the order and decide whether to offer a person.

In classic chatbots NLU is a pipeline of separate components: language detection, intent recognition (a classifier trained on example phrases per intent), entity extraction (patterns and models that pull order IDs, dates, PIN codes and amounts out of text) and sentiment analysis. Each produces a label and a confidence, and a dialogue manager uses them, together with stored conversation state, to choose the next step.

Large language models absorb much of this. One prompt with structured output can return intent, entities, language and sentiment together, handle phrasings nobody trained for and cope better with code-mixed text. What does not go away is the need for the structured result itself: routing rules, analytics dashboards, guardrails, fallbacks and audit trails all need explicit fields with confidences. Many teams therefore ask the LLM to emit the same NLU fields a classic pipeline would, and keep small fast classifiers for high-volume, low-risk decisions.

Key takeaways

  • Natural language understanding (NLU) converts free text into structured fields: language, intent with a confidence, entities and sentiment.
  • Classic bots run NLU as a pipeline of separate models; an LLM can now produce the same fields in one call.
  • Even with an LLM, keep the structured output — routing, analytics, guardrails and fallbacks depend on it.
  • Every NLU decision should carry a confidence; below the threshold, the fallback intent should ask or escalate.
  • Hinglish, relative dates like "kal" and short replies are where NLU for Indian customers most often fails.

02 · How it works, step by step

How does natural language understanding (NLU) work?

  1. Step 1

    Normalise the text

    Clean whitespace and repeated characters, expand common chat shorthand ("pls", "plz", "asap"), keep emoji as signals, and transcribe voice notes with speech-to-text first.

  2. Step 2

    Identify language and script

    Decide whether this is English, Hindi in Devanagari, Hindi in Latin letters or another language, so the right models and replies are used downstream.

  3. Step 3

    Classify the intent

    Score the message against the bot's intents — delivery status, cancel order, refund, talk to agent — and keep the top intent with its confidence. Below the threshold, hand over to the fallback intent.

  4. Step 4

    Extract the entities

    Pull out order IDs, dates, 6-digit PIN codes, amounts and product names, normalise them ("kal" against the message timestamp in IST) and ask for whatever the intent still needs.

  5. Step 5

    Score sentiment and urgency

    Flag frustration or urgency so the queue can be prioritised or a human offered early.

  6. Step 6

    Hand a structured result to the dialogue

    Pass intent, entities, language and sentiment, with confidences, to the dialogue manager, which combines them with conversation state to choose the next message or action.

03Example: A courier's tracking bot in Lucknow

A Lucknow courier company's keyword bot treats any message containing "order" as tracking, so "order cancel karna hai" gets a tracking link and an angry reply. It moves to proper NLU: intents for tracking, cancellation, address change and complaints; entity extraction for 10–14-character AWB numbers and PIN codes; and a 0.7 confidence threshold below which the bot asks "Do you want to track, cancel or change the address?" with three reply buttons. A sentiment flag on messages like "3 din se wait kar raha hoon" routes them to an agent first. Misrouted conversations fall sharply, and the weekly intent report shows address changes are the fastest-growing request.

04Natural language understanding (NLU) in code

{
"text": "order 48213 abhi tak nahi aaya, kal tak aayega? 😡",
"language": { "code": "hi", "script": "Latn", "confidence": 0.86 },
"intent": { "name": "delivery_status", "confidence": 0.91 },
"alternatives": [{ "name": "cancel_order", "confidence": 0.05 }],
"entities": [
{ "type": "order_id", "value": "48213", "start": 6, "end": 11 },
{ "type": "date_ref", "raw": "kal", "resolved": "2026-10-20", "note": "kal = tomorrow here; can also mean yesterday" }
],
"sentiment": { "label": "negative", "score": -0.7 },
"next": "journey.order_status"
}

The shape a dialogue manager consumes, whether a classic pipeline or an LLM produced it.

05Why does natural language understanding (NLU) matter?

NLU is the difference between a bot that matches keywords and one that understands requests. Accurate intents and entities mean fewer "Sorry, I didn't get that" loops, fewer wrong journeys and faster resolution; explicit confidences mean the bot knows when to ask or escalate instead of guessing. For a business, the same structured fields power reporting — what customers ask about, in which language, how angry — which is often as valuable as the automation itself.

06Natural language understanding (NLU): key facts and limits

Core outputs
Language, intent + confidence, entities, sentiment
Indian PIN code
6 digits, first digit 1–9
Indian mobile number
10 digits after +91
Confidence threshold
Tuned per bot; below it the fallback intent fires
Classic vs LLM
Small classifiers: fast and cheap · LLMs: broader, slower, costlier

07 · Common mistakes, and the fix

Common mistakes with natural language understanding (NLU)

  • Training on clean English only

    Real WhatsApp traffic is Hinglish, typos, voice-note transcripts and one-word replies. Train and test on samples of actual messages in every language you serve.

  • Overlapping intents

    "Return", "refund" and "exchange" with near-identical examples confuse any model. Merge intents that lead to the same journey, or add a clarifying question.

  • Ignoring confidence

    Acting on the top intent at 0.4 sends customers down the wrong path. Set a threshold, use the fallback intent below it and track how often it fires.

  • Ambiguous dates and numbers

    "Kal" means both yesterday and tomorrow; "2/3" can be two dates. Resolve against the message timestamp and context, and confirm before acting on a date.

  • Dropping structure when moving to an LLM

    Letting the model reply directly loses the intent and entity data your routing and reports depend on. Ask it for the structured fields as well.

08 · Tips from the bench

Best practices for natural language understanding (NLU)

  • Review a weekly sample of low-confidence messages — they show the intents you are missing.
  • Keep an "other" intent and measure its share; a rising share means the bot's scope has drifted.
  • Store NLU results with each message so analytics and audits can replay decisions.
  • Use reply buttons to collect structured answers where you can, and save free text for what buttons cannot cover.

09NLU FAQs

What is the difference between NLU and NLP?+
NLP is the whole field of processing human language by computer; NLU is the part concerned with meaning — working out what a message is about and what it asks for. Translation or text generation are NLP tasks that are not NLU.
Do I still need NLU if I use an LLM?+
You still need its output. An LLM can do the understanding, but routing, analytics, guardrails and fallbacks need explicit intent, entity and confidence fields, so ask the model to return them in a fixed schema.
What are intents and entities?+
An intent is what the customer wants, such as tracking an order; entities are the details needed to do it, such as the order number or a date. Intent recognition finds the first, entity extraction the second.
How does NLU handle Hinglish?+
Only as well as its training data. Models trained on standard English or Devanagari Hindi often miss romanised Hindi, so include real Hinglish examples, or use an LLM tested on code-mixed text.

From definition to your first message

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.