Artificial Intelligence & Neural Networks β Expert System and Natural Language Processing, NEC licence examination syllabus (Nepal Engineering Council).
NLU and NLG
Understanding language, generating it β and why the two halves are not symmetrical.
π Where this lives: a voice assistant does both, in sequence: it understands "what's the weather in Pokhara tomorrow", queries a service, then generates a spoken sentence from the result. The interesting engineering fact is that they are asymmetric β understanding must handle whatever a human says, while generation only has to produce something a human accepts, and there are usually many acceptable outputs. That asymmetry shapes how each half is built and evaluated. Search "natural language understanding versus generation asymmetry".
Natural Language Understanding
NATURAL LANGUAGE UNDERSTANDING (NLU) is the task of MAPPING
NATURAL LANGUAGE INPUT ONTO A MEANING REPRESENTATION the system
can act upon.
text β [ analysis ] β a structured representation
THE DIRECTION IS MANY-TO-ONE: many surface forms map to the
same meaning.
"Issue a licence to Ram."
"Ram should be issued a licence."
"Give Ram his licence."
"Please process Ram's licence issuance."
ALL FOUR MUST PRODUCE THE SAME REPRESENTATION, something like
issue(agent: officer, object: licence, recipient: Ram)
That collapsing of variation is what "understanding" means
operationally, and it is why canonical forms β Schank's
conceptual dependency primitives from the frames topic β
were invented.
WHAT MAKES NLU HARD, beyond the ambiguity of the previous topic:
Β· the input is UNCONSTRAINED. Users produce typos,
fragments, slang, code-switching between languages, and
sentences no grammar covers.
Β· MEANING DEPENDS ON CONTEXT that may not be in the text
Β· the system must handle what it was NOT designed for
without collapsing
Β· IMPLICIT INFORMATION must be filled in β the restaurant
script from the frames topic exists for exactly this
THE SUBTASKS OF NLU, in the order they are usually applied:
TOKENISATION and normalisation
POS TAGGING
PARSING to a syntactic structure
NAMED ENTITY RECOGNITION
COREFERENCE RESOLUTION
WORD SENSE DISAMBIGUATION
SEMANTIC ROLE LABELLING β who did what to whom
INTENT CLASSIFICATION and SLOT FILLING (in dialogue
systems): the intent is what the user wants, the slots are
the parameters
"Book a flight to Delhi on Tuesday"
intent: BookFlight
slots: destination = Delhi, date = Tuesday
MAPPING to a logical form or an action
THE OUTPUT REPRESENTATIONS, and each connects to ACtE0903:
A LOGICAL FORM in first-order logic
A FRAME with slots filled β the FrameNet approach
A SEMANTIC NETWORK fragment
A DATABASE QUERY (semantic parsing: text to SQL)
AN API CALL with arguments
THE CHOICE DEPENDS ON WHAT THE SYSTEM WILL DO WITH IT, which
is the granularity issue from the KR topic β represent no more
detail than the task requires.
Natural Language Generation
NATURAL LANGUAGE GENERATION (NLG) is the reverse: PRODUCING
NATURAL LANGUAGE TEXT FROM A NON-LINGUISTIC REPRESENTATION.
structured data β [ generation ] β text
THE DIRECTION IS ONE-TO-MANY: one meaning has many acceptable
expressions, and the system must CHOOSE. That choice β what to
say, in what order, in what words β is the whole difficulty, and
it is a difficulty of DECISION rather than of INTERPRETATION.
THE CLASSICAL PIPELINE, three stages (Reiter and Dale):
1. DOCUMENT PLANNING (macro-planning)
CONTENT DETERMINATION β what information to include, and
what to leave out. Usually the hardest decision, because
the input data contains far more than should be said.
DOCUMENT STRUCTURING β the order and the rhetorical
relations between the parts
2. MICROPLANNING (sentence planning)
LEXICALISATION β choosing the words. "Increased",
"rose", "went up", "climbed" all express the same
relation with different connotations.
AGGREGATION β combining facts into single sentences rather
than emitting one sentence per fact
REFERRING EXPRESSION GENERATION β deciding between "the
applicant", "Ram", "he", and "the 21-year-old from
Chitwan". Getting this wrong produces text that is either
repetitive or ambiguous.
3. SURFACE REALISATION
Applying grammar and morphology to produce the final
string: word order, agreement, inflection, punctuation.
A WORKED GENERATION, from the study tracker's own data:
INPUT (structured):
student: Ram
topics_done: 412 of 519
subjects_complete: 8
exam_date: 2026-11-14
days_remaining: 99
weakest_subject: ACtE09 (4 of 56)
CONTENT DETERMINATION β what matters? The exam is in 99 days
and one subject is badly behind. The count of completed
subjects is encouraging but less actionable. DECIDE: lead
with the gap, mention the progress for context, omit the
exact date since "99 days" conveys it.
STRUCTURING β progress first (establishes credibility), then
the problem, then the recommendation.
LEXICALISATION β "behind" rather than "failing";
"worth prioritising" rather than "you must".
AGGREGATION β combine the two counts into one clause instead
of two sentences.
REFERRING EXPRESSIONS β "you" throughout; name the subject
once and then use "it".
REALISATION:
"You've completed 412 of 519 topics with 8 subjects
finished β good progress with 99 days left. Artificial
Intelligence is the outlier at 4 of 56 topics, so it is
worth prioritising next."
NOTE HOW MANY DECISIONS PRODUCED TWO SENTENCES. Every one of
them could have gone differently and produced acceptable
output, which is why NLG has no single correct answer and
cannot be evaluated by exact match.
THREE APPROACHES TO NLG, in increasing flexibility:
TEMPLATE-BASED fixed strings with slots.
"You have completed {n} of {total} topics."
β predictable, controllable, cannot produce nonsense
β still the right choice for most business reporting
β rigid, and repetitive across many outputs
RULE-BASED / PIPELINE the three stages above, implemented
with explicit grammars and choice rules
β flexible, linguistically principled
β laborious to build
NEURAL / LEARNED a model trained to map input to text
β fluent and varied
β may HALLUCINATE facts not in the input β the decisive
problem for any report that must be accurate, and the
reason template-based generation persists in finance
and medicine
Why the two are asymmetric
NLU AND NLG ARE NOT MIRROR IMAGES, and the differences are
examinable.
NLU NLG
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
many surface forms β one one meaning β many acceptable
meaning (many-to-one) forms (one-to-many)
the input is given and the input is complete and
uncontrolled controlled
the problem is AMBIGUITY β the problem is CHOICE β
which reading was meant? which expression to use?
failure = misunderstanding failure = awkward, verbose or
misleading text
evaluable against a gold NO single correct output, so
annotation evaluation is hard
must handle input outside its generates only within its own
design capability
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
THE EVALUATION ASYMMETRY IS THE PRACTICAL ONE. NLU output can be
compared with a human-annotated answer and scored. NLG output
cannot, because a different-but-good sentence would score badly.
The workarounds:
BLEU, ROUGE, METEOR n-gram overlap with reference texts.
Cheap, and they penalise legitimate
paraphrase β a serious known
weakness.
HUMAN EVALUATION raters score fluency, adequacy and
correctness. The gold standard, and
expensive.
TASK-BASED does the generated text let a reader
do the job? The most meaningful and
least used.
WHICH IS HARDER? A defensible answer, since exams ask:
NLU IS HARDER IN PRINCIPLE, because it must cope with
arbitrary input, unbounded ambiguity and unstated world
knowledge β the trophy-and-suitcase problem has no
generation counterpart.
NLG IS HARDER TO EVALUATE AND TO CONTROL, because there is
no target to compare against and a fluent system can be
confidently wrong.
IN THE ERA OF LARGE LANGUAGE MODELS THE PRACTICAL DIFFICULTY
HAS SHIFTED TOWARD GENERATION, precisely because fluency
became easy while FAITHFULNESS TO THE INPUT DATA did not.
A COMPLETE DIALOGUE SYSTEM uses both, with state in between:
1. speech recognition (if spoken) β text
2. NLU: intent + slots β structured
3. DIALOGUE STATE TRACKING β accumulate what is known
across turns, and identify what is still missing
4. DIALOGUE POLICY β decide the next action: answer, ask a
clarifying question, confirm, or hand off
5. NLG β text
6. speech synthesis (if spoken) β audio
THE PARTS THE SYLLABUS'S NLU/NLG SPLIT OMITS ARE 3 AND 4, and
they are where most real dialogue systems fail. A system that
understands each utterance perfectly and forgets the previous
turn is useless β which is the discourse level of the previous
topic, appearing as an architectural requirement.
AND A NOTE ON WHERE THIS SITS RELATIVE TO THE REST OF THE
SECTION: NLU produces exactly the representations of ACtE0903 β
logical forms, frames, semantic networks β and NLG consumes
them. THE KNOWLEDGE REPRESENTATION SECTION IS THE MIDDLE OF THIS
PIPELINE, which is why the two sections sit together in the
syllabus.
The asymmetry worth remembering: NLU is many-to-one and its problem is ambiguity; NLG is one-to-many and its problem is choice. That difference explains the evaluation gap β an understanding system can be scored against a correct answer, and a generation system has no single correct answer to be scored against.
π Go further: the faithfulness problem in neural NLG has a name and a partial cure. Retrieval-augmented generation constrains the model by fetching the relevant source material first and requiring the output to be grounded in it, often with citations back to the retrieved passages so a reader can check. It does not eliminate hallucination but it makes it detectable, which is the practical difference for any report that must be accurate β and it is why regulated domains still prefer template-based generation, where the output cannot contain a fact the input did not. Search "retrieval augmented generation grounding faithfulness".
π‘ Exam angle: define NLU and NLG and state the direction of each β many-to-one versus one-to-many. List the NLU subtasks (tokenisation, POS tagging, parsing, NER, coreference, sense disambiguation, semantic role labelling, intent and slot filling) and the output representations. Reproduce the three-stage NLG pipeline β document planning (content determination, structuring), microplanning (lexicalisation, aggregation, referring expressions), surface realisation β since that breakdown is the standard question. Compare the three NLG approaches (template, rule-based, neural) with their trade-offs. Be ready to explain the asymmetry and why NLG evaluation is hard.
Syllabus points
Natural language understanding
Natural language generation
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Related topics in Expert System and Natural Language Processing