Artificial Intelligence & Neural Networks β Expert System and Natural Language Processing, NEC licence examination syllabus (Nepal Engineering Council).
NLP Terminology
The vocabulary of language processing, and why ambiguity is the whole problem.
π Where this lives: every autocomplete, spam filter, search engine, translation app and voice assistant is doing the processing named in this topic. And the reason language resisted computers for fifty years is the single fact this topic is built around: almost every sentence has multiple valid readings, and humans resolve them so effortlessly that they cannot say how. Search "natural language ambiguity resolution levels of analysis".
The levels of analysis
NATURAL LANGUAGE PROCESSING (NLP) is the branch of AI concerned
with enabling computers to understand, interpret and generate
human language.
LANGUAGE IS ANALYSED AT SEVERAL LEVELS, conventionally listed
from the surface inwards. Each level has its own ambiguities.
1. PHONOLOGY β the sound structure of language
Relevant to speech input and output. "recognise speech"
versus "wreck a nice beach" is a phonological ambiguity:
the same acoustic signal, two segmentations.
2. MORPHOLOGY β the structure of words
Words decompose into MORPHEMES, the smallest meaningful
units:
unhappiness = un- + happy + -ness
running = run + -ing
STEMMING reduces a word to a crude root by chopping
suffixes: "running" β "run", but also "universities" β
"univers" β fast and sometimes wrong.
LEMMATISATION reduces it to its dictionary form using
knowledge of the language: "ran" β "run", "better" β
"good". Slower and correct.
INFLECTIONAL morphology marks grammar (plural, tense);
DERIVATIONAL morphology creates new words (happy β
happiness).
3. LEXICAL β the words themselves and what they can mean
TOKENISATION splits text into TOKENS. Harder than it looks:
"Dr. Sharma isn't in Kathmanduβhe's in New Delhi."
Where do the sentences end? Is "isn't" one token or two?
Is "New Delhi" one token? Is the em-dash a boundary?
PART-OF-SPEECH (POS) TAGGING assigns a grammatical
category to each token: noun, verb, adjectiveβ¦
LEXICON: the vocabulary, with each word's possible parts of
speech and senses.
4. SYNTAX β how words combine into phrases and sentences
PARSING builds a structure showing the grammatical
relationships. Two common outputs:
CONSTITUENCY (phrase-structure) TREE β nested phrases
DEPENDENCY TREE β direct head-modifier links between
words
A GRAMMAR specifies the legal structures. CONTEXT-FREE
GRAMMARS are the standard formalism:
S β NP VP
NP β Det N | Det N PP | ProperNoun
VP β V NP | V NP PP
PP β P NP
5. SEMANTICS β the meaning of the words and structures
WORD SENSE DISAMBIGUATION picks which sense of a word is
intended.
SEMANTIC ROLE LABELLING identifies who did what to whom:
the AGENT, the PATIENT, the INSTRUMENT.
Output is often a LOGICAL FORM β a first-order or similar
representation, connecting this section to ACtE0903.
6. PRAGMATICS β meaning in context, beyond the literal
"Can you pass the salt?" is a request, not a question about
ability. "It's cold in here" may be a request to close the
window.
Includes SPEECH ACTS, IMPLICATURE, and the fact that the
intended meaning may differ from the stated one.
7. DISCOURSE β structure across sentences
ANAPHORA RESOLUTION: what does a pronoun refer to?
"Ram told Hari that he had passed." β who passed?
COREFERENCE: which expressions denote the same entity?
COHESION and the overall structure of a text.
8. WORLD KNOWLEDGE β everything else
"The trophy would not fit in the suitcase because it was
too big." β "it" is the trophy.
"β¦because it was too small." β "it" is the suitcase.
THE SENTENCES ARE SYNTACTICALLY IDENTICAL. Resolving the
pronoun requires knowing that big things do not fit into
small containers, which is not linguistic knowledge at all.
THIS IS THE HARDEST LEVEL, and it is why NLP is an AI
problem rather than a linguistics problem.
Ambiguity β the central difficulty
AMBIGUITY OCCURS AT EVERY LEVEL, and the readings MULTIPLY.
LEXICAL AMBIGUITY β one word, several senses
"bank" β a financial institution, a river's edge, to tilt an
aircraft, a row of switches. WordNet lists 10 noun senses
and 8 verb senses.
"I went to the bank." β which?
SYNTACTIC (STRUCTURAL) AMBIGUITY β one sentence, several parses
"I saw the man with the telescope."
reading 1: I used the telescope to see him
(PP attaches to the verb)
reading 2: the man had the telescope
(PP attaches to the noun)
BOTH PARSES ARE GRAMMATICALLY VALID. The grammar cannot
choose; only meaning and context can.
AND THE COUNT GROWS ALARMINGLY. The number of ways to
attach n prepositional phrases follows the CATALAN NUMBERS:
1 PP β 1 parse
2 PPs β 2
3 PPs β 5
4 PPs β 14
5 PPs β 42
6 PPs β 132
"I saw the man on the hill with the telescope in the
park near the river" has SIX attachment sites and
therefore 132 syntactically valid readings, of which a
human considers exactly one.
SEMANTIC AMBIGUITY β one structure, several meanings
"Every student read a book." β the same book, or one each?
This is the quantifier scope problem from the FOPL topic:
βb βs Read(s, b) versus βs βb Read(s, b)
REFERENTIAL AMBIGUITY β pronouns
"The city council refused the demonstrators a permit because
they feared violence." β who feared? The council.
"β¦because they advocated violence." β the demonstrators.
Again, syntactically identical; resolved only by knowing how
councils and demonstrators behave.
PRAGMATIC AMBIGUITY
"Can you open the window?" β a question or a request?
THE MULTIPLICATION IS THE KILLER. A five-word sentence in which
the words have 3, 4, 2, 5 and 3 senses respectively has
3 Γ 4 Γ 2 Γ 5 Γ 3 = 360
sense combinations, BEFORE syntactic ambiguity multiplies it
further. A parser that enumerates possibilities and a
disambiguator that scores them cannot be separated β the space
is too large.
HOW HUMANS RESOLVE IT, and it is worth stating because it
explains the field's trajectory:
Β· WORLD KNOWLEDGE (trophies, suitcases, councils)
Β· CONTEXT from the surrounding discourse
Β· FREQUENCY β the common sense of a word is usually right
Β· PLAUSIBILITY β which reading describes a likely situation
THE FIRST TWO ARE HARD TO ENGINEER; THE LAST TWO ARE
STATISTICAL. That asymmetry is exactly why NLP shifted from
hand-written grammars to statistical methods trained on
corpora β the tractable part of human disambiguation is the
part that counts frequencies.
Other terminology, and the two traditions
TERMS THAT APPEAR IN EXAM QUESTIONS:
CORPUS (plural CORPORA) a body of text used for training or
analysis. An ANNOTATED corpus has
labels β parts of speech, parses,
named entities β and building one is
the expensive part.
TREEBANK a corpus annotated with parse trees.
The Penn Treebank made statistical
parsing possible.
N-GRAM a contiguous sequence of n tokens.
Unigram, bigram, trigram. The basis
of the simplest language models.
LANGUAGE MODEL a probability distribution over
sequences: how likely is this
sentence? Used to choose between
candidate readings.
STOP WORDS very frequent words (the, of, and)
often removed in retrieval tasks
BAG OF WORDS a representation counting words and
ignoring order. Crude and
surprisingly effective for
classification.
TF-IDF term frequency Γ inverse document
frequency β weights a word by how
often it appears here and how rare
it is overall
NAMED ENTITY RECOGNITION finding and classifying names of
(NER) people, places, organisations, dates
EMBEDDING a dense numeric vector representing a
word or sentence, positioned so that
similar meanings are nearby
PERPLEXITY a measure of how well a language
model predicts held-out text; lower
is better
ZIPF'S LAW, worth knowing because it shapes every practical
decision in NLP: word frequency is inversely proportional to
rank. The consequences:
Β· the top ~100 words account for roughly half of all tokens
in running text
Β· a LONG TAIL of words appears once or twice, so any
corpus, however large, contains words the system has never
seen β the OUT-OF-VOCABULARY problem
Β· this is why subword tokenisation exists: break rare words
into familiar pieces rather than treating them as unknown
THE TWO TRADITIONS IN NLP, and the field's trajectory:
SYMBOLIC / RULE-BASED
hand-written grammars, lexicons and rules
β precise, explainable, works with no data
β handles rare constructions the statistics never saw
β BRITTLE β real language violates every rule
β enormous hand-crafting effort, and the ambiguity explosion
above means the rules must also encode preferences
THE ACQUISITION BOTTLENECK AGAIN, in a new domain.
STATISTICAL / MACHINE LEARNING
learn from annotated or raw corpora
β robust to variation, and improves with more data
β frequency and plausibility come for free, which is exactly
the part of human disambiguation that is tractable
β needs data; inherits its biases
β opaque, and confidently wrong on inputs unlike the
training text
THE TRAJECTORY: rules (1950sβ80s) β statistical methods with
hand-designed features (1990sβ2000s) β neural networks learning
the features (2010s) β large pre-trained models (2020s). AT EACH
STEP MORE OF THE SYSTEM WAS LEARNED AND LESS WAS DESIGNED.
WHAT HAS NOT CHANGED: the LEVELS in the first section still
describe what must happen, and AMBIGUITY is still the central
problem. A modern model resolves it by having seen enormous
quantities of text rather than by reasoning about trophies and
suitcases β which is why it succeeds on common cases and can
fail oddly on constructed ones. THE PROBLEM WAS NOT SOLVED SO
MUCH AS OVERWHELMED WITH DATA.
The trophy-and-suitcase pair is the clearest demonstration that NLP is an AI problem rather than a linguistics one. Two sentences differing in one word, syntactically identical, and the pronoun refers to opposite things β resolvable only by knowing that big objects do not fit inside small containers, which no grammar contains.
π Go further: the sentences in this topic are not casual examples β they are from the Winograd Schema Challenge, proposed as a replacement for the Turing test precisely because it cannot be passed by fluent pattern-matching. Each item is a pair differing in one word, with the pronoun's referent flipping, so statistical association over surface forms should score at chance. Large language models now do well on it, and the interesting open question is whether that demonstrates acquired world knowledge or a subtler statistical regularity β a question the benchmark was designed to make sharp rather than to settle. Search "Winograd Schema Challenge commonsense benchmark".
π‘ Exam angle: list the levels of analysis β phonology, morphology, lexical, syntax, semantics, pragmatics, discourse, world knowledge β with what each handles and an example of its ambiguity; this enumeration is the standard question. Distinguish stemming from lemmatisation and inflectional from derivational morphology. Name the types of ambiguity (lexical, syntactic/structural, semantic, referential, pragmatic) with an example each β "I saw the man with the telescope" is the expected syntactic one. Define the key terms: corpus, treebank, n-gram, language model, bag of words, TF-IDF, NER, embedding. Be ready to compare the rule-based and statistical traditions.
Syllabus points
Key NLP terms
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