Skip to main content

NLU and NLG; NLP steps

Short answer

NLU converts human language into a structured meaning representation (e.g., extracting intent and entities from “Book a flight to Pokhara tomorrow”). NLG generates natural language from data (e.g., weather data to text). NLP steps: phonetic/phonological, morphological, syntactic, semantic, discourse, and pragmatic analysis.

Define a NLU and a NLG. List down the different steps involved in natural language processing (NLP) with suitable examples.

NLU (natural language understanding)

NLU is the part of NLP that converts human language input (text or speech) into a structured machine-usable meaning representation. It deals with ambiguity, context and intent. Example: from "Book a flight to Pokhara tomorrow" it extracts intent = book_flight, destination = Pokhara, date = tomorrow.

NLG (natural language generation)

NLG is the part of NLP that produces natural language text or speech from structured data or an internal meaning representation. Steps: content determination, sentence planning and surface realisation. Example: from weather data (temp = 28, rain = 70%) it writes "It will be warm today with a high chance of rain."

Steps of natural language processing

 Speech -> Phonetic -> Morphological -> Syntactic
        -> Semantic -> Discourse -> Pragmatic -> Meaning
  1. Phonetic / phonological analysis: converts speech into phonemes and words (for spoken input only).
  2. Morphological (lexical) analysis: breaks words into roots and affixes. "Walking" = walk + ing; "unhappy" = un + happy.
  3. Syntactic analysis (parsing): checks grammar and builds a parse tree. "The dog chased the cat": S -> NP(The dog) VP(chased NP(the cat)).
  4. Semantic analysis: finds the literal meaning: chase(dog, cat). It rejects "The idea chased the cat" as meaningless.
  5. Discourse integration: links the sentence with the earlier ones. "Ram bought a car. He drove it home." (He = Ram, it = car).
  6. Pragmatic analysis: gets the intended meaning in context. "Can you close the window?" is a polite request.

NLU covers steps 1-6 for analysing the input, and NLG performs the reverse path (meaning to sentence to text or speech) to produce the output.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Artificial Intelligence chapter 7 questions →