Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 1 — Levels of Language Processing: Morphological & Lexical

Lesson 3 of 39 in the free Natural Language Processing notes on Siksha Sarovar, written by Rohit Jangra.

Levels of Language Processing

Human language can be analysed at several distinct levels, from the smallest meaningful unit up to full documents. An NLP system typically processes text through these levels in sequence.

LevelDeals WithExample
PhonologicalSounds of speech (relevant for speech processing)Pronunciation of "read" (present vs past)
MorphologicalStructure of words — smallest meaning-bearing units"unhappiness" = un + happy + ness
LexicalMeaning of individual words (word-level)"bank" has multiple senses
SyntacticGrammatical structure of sentencesSubject-verb-object arrangement
SemanticMeaning of sentences"Colorless green ideas sleep furiously" is grammatical but meaningless
DiscourseMeaning across multiple sentencesPronoun resolution across sentences
PragmaticMeaning in context of real-world useSarcasm, intent behind an utterance

This lesson covers the first two: morphological and lexical analysis.

Morphological Analysis

Morphology studies the internal structure of words. A morpheme is the smallest unit of language that carries meaning — it cannot be broken down further without losing meaning.

TermMeaningExample
Free morphemeCan stand alone as a word"happy", "run", "book"
Bound morphemeMust attach to another morpheme"un-", "-ness", "-ing", "-s"
Root/StemCore morpheme carrying the main meaning"happy" in "unhappiness"
PrefixBound morpheme added before the root"un-" in "unhappy"
SuffixBound morpheme added after the root"-ness" in "happiness"
word = "unhappiness"
# Morphological decomposition:
#   un- (prefix, negation) + happy (root) + -ness (suffix, forms noun)
print("Root:", "happy")
print("Prefix:", "un-")
print("Suffix:", "-ness")

Types of morphological processes:

  1. Inflection — modifies a word for grammar without changing its category: "walk" → "walked", "walks", "walking" (still a verb).
  2. Derivation — creates a new word, often changing category: "happy" (adjective) → "happiness" (noun).
  3. Compounding — combining two free morphemes: "note" + "book" = "notebook".

Lexical Analysis

Lexical analysis is the study of words and their meanings at the level of the lexicon (vocabulary). It involves:

  • Identifying word tokens and their part of speech
  • Mapping a word to its dictionary entry (lemma)
  • Resolving word senses in context (e.g. "bat" — animal vs cricket bat)
import nltk
from nltk import pos_tag, word_tokenize

text = "The bank raised interest rates."
tokens = word_tokenize(text)
tagged = pos_tag(tokens)
print(tagged)
# [('The', 'DT'), ('bank', 'NN'), ('raised', 'VBD'),
#  ('interest', 'NN'), ('rates', 'NNS'), ('.', '.')]

Here, lexical analysis tells us "bank" is a noun (NN) — but it does not yet resolve which sense of "bank" is intended; that is the job of Word Sense Disambiguation, covered in Unit 2.