0% found this document useful (0 votes)
6 views108 pages

Unit-I: Syllabus

The document outlines a syllabus for a course on Natural Language Processing (NLP), covering topics such as syntax, semantics, pragmatics, machine learning, and information retrieval. It details various NLP tasks, applications, and challenges, including ambiguity and context understanding, while also discussing the role of machine learning in automating and improving NLP systems. Additionally, it introduces key concepts in probability and information theory relevant to NLP, along with practical examples and applications.

Uploaded by

l.kalpana1703
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views108 pages

Unit-I: Syllabus

The document outlines a syllabus for a course on Natural Language Processing (NLP), covering topics such as syntax, semantics, pragmatics, machine learning, and information retrieval. It details various NLP tasks, applications, and challenges, including ambiguity and context understanding, while also discussing the role of machine learning in automating and improving NLP systems. Additionally, it introduces key concepts in probability and information theory relevant to NLP, along with practical examples and applications.

Uploaded by

l.kalpana1703
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

lOMoARcPSD|62849738

SYLLABUS
UNIT–I
Natural Language Processing tasks in syntax, semantics, and pragmatics – Issue-
Applications – The role of machine learning – Probability Basics –Information
theory – Collocations -N-gram Language Models – Estimating parameters and
smoothing – Evaluating language models.
UNIT 2
Word Level Analysis: Regular Expressions-Finite-State Automata-Morphological
Parsing-Spelling Error Detection and correction-Words and Word classes-Part-of
Speech Tagging. Syntactic Analysis: Context-free Grammar-Constituency-
Parsing Probabilistic Parsing.=
UNIT 3
Semantic Analysis: Meaning Representation-Lexical Semantics- Ambiguity-
Word Sense Disambiguation. Discourse Processing: cohesion-Reference
Resolution- Discourse Coherence and Structure.
UNIT 4
Architecture of NLG Systems- Generation Tasks and Representations-
Application of NLG. Machine Translation: Problems in Machine Translation.
Characteristics of Indian Languages- Machine Translation Approaches-
Translation involving Indian Languages.
UNIT 5
Information Retrieval: Design features of Information Retrieval Systems-
Classical, Non-classical, Alternative Models of Information Retrieval – valuation
Lexical Resources: WorldNet Frame Net Stemmers- POS Tagger- Research
Corpora SSAS.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

UNIT–I
Introduction

NaturalLanguage Processing tasks in syntax, semantics, and pragmatics –


Issue- Applications – The role of machine learning – Probability Basics –
Information theory – Collocations -N-gramLanguage Models – Estimating
parameters and smoothing – Evaluating language models.

NaturalLanguage Processing:

Natural Language Processing (NLP) is a branch of Artificial


Intelligence (AI) that helps computers understand, interpret, and generate
human language — the way people naturally speak and write.

Natural Language Processing (NLP) is a field of computer science


and linguistics that focuses on enabling machines to process and analyze
large amounts of natural language data.
Example:

When you ask “What’s the weather today?” to Alexa or Google Assistant,
NLP helps the system:

1. Understand your words (speech recognition)


2. Interpret the meaning (language understanding)
3. Give a meaningful response (language generation)

Tasks in NLP:

 Tokenization – Splitting sentences into words or phrases

 Part-of-Speech Tagging – Identifying nouns, verbs, adjectives, etc.

 Named Entity Recognition (NER) – Finding names, places, organizations

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Sentiment Analysis – Detecting emotions or opinions

 Machine Translation – Translating one language to another

 Text Summarization – Creating short summaries from large text

 Chatbots and Q&A Systems – Understanding and responding to human


queries

Applications of NLP:

 Chatbots (e.g., ChatGPT 🤖)


 Voice Assistants (Siri, Alexa)
 Spam Email Filtering
 Sentiment Analysis in Social Media
 Automatic Translation (Google Translate)
 Document Summarization

In Natural Language Processing (NLP), tasks are often grouped according to


levels of language understanding:

➡️Syntax (Structure)
➡️Semantics (Meaning)
➡️Pragmatics (Context & Intention)

[Link] (Structure of Language)

Definition:

Syntax in NLP deals with the grammatical structure of sentences — how


words are arranged and related to each other according to language rules.

Main Goal:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

To make the computer understand how a sentence is constructed.

Real-Time Example:

Grammar Checkers like Grammarly or MS Word use syntactic analysis


to detect grammar mistakes.

Example Sentence:

“She go to school every day.”


NLP Output: Suggests correction → “She goes to school every day.”
This happens because the system understands the structure is wrong.

2. Semantics (Meaning of Language)

Definition:

Semantics in NLP focuses on the meaning of words and sentences — what the
text actually means.

Main Goal:

To enable the computer to understand what is being said, not just the words used.

Real-Time Example:

Google Search uses semantic analysis to understand meaning.

Example Sentence:

When you search “Apple price today,”


the system understands “Apple” means the company, not the fruit, by
analyzingcontext and meaning.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

[Link] (Context & Intention of Language)

Definition:

Pragmatics in NLP deals with the context, situation, and user’s intention
— how meaning changes depending on where, when, and how it’s used.

Main Goal:

To understand what the speaker actually means, not just the literal
meaning.

Real-Time Example:

Virtual Assistants (Alexa, Siri, ChatGPT) use pragmatic understanding.

Example Conversation:

User: “It’s very hot here.”


System: “Should I turn on the fan?”
✅The system understands the intention behind the statement — it’s not just an
observation, it’s a request.

Issues in NLP (Natural Language Processing)

1. Ambiguity

 Definition: A single sentence can have multiple meanings, making it hard


for computers to interpret correctly.
 Example: “I saw the man with the telescope.” → Who has the telescope —
me or the man?

2. Synonymy

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Definition: Different words can have the same meaning, causing confusion
in interpretation.
 Example: “Big” and “Large” both mean the same, but used differently in
sentences.

3. Polysemy

 Definition: A single word can have more than one meaning based on
context.
 Example: “Bank” → can mean a financial institution or a river bank.

4. Context Understanding

 Definition: NLP systems find it difficult to use real-world or situational


context to understand meaning.
 Example: “He is cool” → could mean calm or stylish depending on
context.

5. Slang and Informal Language

 Definition: People often use slang, short forms, or emojis that computers
struggle to understand.
 Example: “LOL”, “BTW”, “U r gr8” are hard for NLP systems to interpret
properly.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

6. Speech and Accent Variations

 Definition: In speech-based NLP, pronunciation and accent differences


make recognition difficult.
 Example: The word “Data” is pronounced differently in the US and UK.

7. Sarcasm and Emotion Detection

 Definition: NLP systems find it hard to detect sarcasm or emotional tone.


 Example: “Great! Another rainy day!” → sounds positive but actually
negative.

8. Code-Mixing (Multiple Languages)

 Definition: People mix two or more languages in a single sentence, making


analysis complex.
 Example: “I am going to market la.” → English + Tamil mixed.

Applications of Natural Language Processing (NLP)

1. Machine Translation

It is the process of automatically converting text or speech from one language to


another using NLP techniques.

Example: Google Translate.

2. Sentiment Analysis

It is used to identify and analyze the emotions or opinions expressed in text as


positive, negative, or neutral.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example: Analyzing customer reviews on social media.

3. Chatbots and Virtual Assistants

These systems use NLP to understand human language and respond intelligently
in conversation.

Example: Siri, Alexa, ChatGPT.

4. Text Summarization

It automatically generates a short and meaningful summary from a large


document or article.

Example: Summarizing long news reports.

5. Speech Recognition

This application converts spoken words into written text using NLP and AI
models.

Example: Voice typing in Google Assistant.

6. Information Retrieval

It helps find and extract relevant information from large text datasets or the
internet.

Example: Google search engine results.

7. Spam Detection

NLP filters unwanted or irrelevant messages by analyzing their content and


language patterns.

Example: Gmail detecting spam or phishing emails.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

8. Named Entity Recognition (NER)

It identifies names of people, organizations, dates, and places in a text


automatically.

Example: Extracting “India” as a location or “Apple” as a company.

9. Text Classification

It categorizes text into specific labels or topics using NLP algorithms.

Example: Classifying news into sports, politics, or entertainment.

10. Question Answering Systems

These systems understand natural language questions and give accurate answers.

Example: Google’s featured snippets or AI-based Q&A bots.

Role of Machine Learning

Definition:
Machine Learning (ML) is a branch of Artificial Intelligence (AI) that enables
systems to automatically learn and improve from experience without being
explicitly programmed.

Basic Roles of Machine Learning:

1. Automation of Tasks:
ML helps automate repetitive and complex tasks — for example, spam
detection in emails or product recommendations in e-commerce.
2. Data Analysis and Prediction:
ML models analyze large amounts of data to find hidden patterns and make
predictions — such as predicting stock prices or weather forecasts.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

3. Decision Making:
ML supports better decision-making by providing data-driven insights,
such as customer behavior analysis or fraud detection.
4. Personalization:
It helps tailor experiences for users — like personalized ads, playlists
(Spotify), or movie suggestions (Netflix).
5. Continuous Improvement:
ML systems improve performance over time as they are exposed to new
data — for instance, voice assistants like Siri and Alexa get smarter with
usage.

Example:

 Application: Predicting whether a loan applicant will default or not.


 How ML Works: The model is trained with past loan data (income, credit
score, loan amount, etc.) and learns patterns to predict future defaults.

Probability Basics in NLP:

Probability in NLP refers to the mathematical foundation used to model


uncertainty in language — that is, to estimate how likely a word, phrase, or
sentence is to occur.

It helps NLP systems predict words, analyze context, and make decisions
based on data patterns.

Real-Time Example:

In predictive text (like in WhatsApp or Gmail), when you type “How are”,

the system predicts the next word — e.g., “you” — based on conditional

probability from previous data.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example:

P(“you” | “How are”) is higher than P(“they” | “How are”),

so “you” is suggested.

Information Theory

Definition

Information Theory in NLP deals with measuring information,


uncertainty, and similarity in language.

It helps machines quantify how much information words or sentences


carry, and how predictable or surprising they are in context.

Key Concepts in Information Theory (used in NLP)

Concept Definition Example / Use in NLP


Entropy (H) Measures uncertainty or If a word has many possible next
unpredictability in a words, the entropy is high.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Concept Definition Example / Use in NLP


Example: predicting next word
language model.
after “I saw a ___”.
Measures how well a Used to evaluate language
Cross-Entropy probability model predicts models — lower cross-entropy
actual data. means better prediction.
Exponential of cross- Lower perplexity = better
Perplexity entropy; measures how language model. Used in speech
“confused” a model is. recognition and text generation.
Measures how much
Mutual
knowing one variable Used to find word associations,
Information
reduces uncertainty about like “New” ↔ “York”.
(MI)
another.
KL Divergence Measures difference Used in training models (e.g.,
(Kullback– between two probability comparing predicted vs. true word
Leibler) distributions. distributions).
Bits and Each bit reduces uncertainty Text compression, token encoding
Probability by half. in GPT/BERT models.

Applications of Information Theory in NLP

1. Language Modeling – Estimating probability of word sequences using


entropy and perplexity.
2. Text Classification – Using information gain to select most informative
features (words).
3. Machine Translation – Comparing language distributions using cross-
entropy.
4. Word Embedding Evaluation – Using mutual information to detect
strong semantic relations.
5. Speech Recognition – Minimizing entropy to make predictions more
confident.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

6. Information Retrieval – Ranking documents using information gain and


relevance scoring.

Example:

“I am going to ___” — many options (school, market, temple) → high entropy.


But “I am eating ___” → limited options (food items) → low entropy.

Collocations

Definition:

Collocations in NLP are pairs or groups of words that frequently occur


together in natural language — more often than by random chance.

🔹In short: Common word combinations that sound “natural” to native


speakers.

📘Concept Explanation
Term Meaning Example
Two or more words that usually appear “Strong tea” ✅ (not
Collocation
together in a specific order. powerful tea)
NLP uses measures like Mutual “New York”,
Statistical
Information (MI) or t-score to find word “machine learning”,
Approach
pairs that appear together frequently. “data science”
Collocations can be different grammatical “make a decision”,
Syntactic
combinations like adjective+noun, “heavy rain”, “take a
Type
verb+noun, etc. break”

🔍Types of Collocations

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Type Structure Example


Adjective + Noun Describes a quality. “Strong coffee”, “Heavy rain”
Verb + Noun Common actions. “Make a mistake”, “Do homework”
Noun + Noun Compound nouns. “Data science”, “Machine learning”
Verb + Adverb Action intensity. “Run fast”, “Speak loudly”
Adverb + Adjective Emphasis. “Deeply concerned”, “Highly effective”

⚙️How NLP Detects Collocations

NLP algorithms use statistical measures:

1. Mutual Information (MI) – Measures how much knowing one word helps
predict the other.
2. t-score – Checks how significant their co-occurrence is.
3. Frequency Count – Simple count of how often the two words appear
together in a large corpus.

Example:
If “machine” and “learning” appear together very often → NLP marks it as a
collocation.

💡Real-Time Examples of Collocations


Domain Collocation Example Usage
General English “Fast food”, “Take a seat” Daily conversation
Business “Market share”, “Customer service” Business reports
Technology “Artificial intelligence”, “Machine learning” Research and NLP
Education “Make progress”, “Give a presentation” Classroom context
News/Media “Breaking news”, “Public opinion” Journalism

N-gram Language Model

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Definition

An N-gram Language Model is a probabilistic model in NLP that predicts the


next word in a sequence based on the previous (N-1) words.

It estimates,

P(w_n | w_{n-1}, w_{n-2}, ..., w_{n-(N-1)})


]
using observed word sequences from a corpus.

Concept Explanation
Term Meaning Example
“I love NLP” → bigrams: (I
N-gram A sequence of N consecutive words.
love), (love NLP)
Unigram Single word (N=1). “I”, “love”, “NLP”
Bigram Two words together (N=2). “I love”, “love NLP”
Trigram Three words together (N=3). “I love NLP”
More context, better accuracy but
Higher N 4-gram, 5-gram etc.
needs more data.

⚙️Example Calculation

Sentence: “I love NLP”


Suppose corpus counts are:

 Count(“I love”) = 20
 Count(“love NLP”) = 10
 Count(“love”) = 25

Bigramprobability:P(NLP∣love)=Count(love,NLP)/Count(love)
=10/25=0.4P→ 40% chance “NLP” comes after “love”.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🔍Real-Time Examples
Use Case Explanation Example
Type “How are” → predicts
Text Prediction Predicts next likely word.
“you”.
Speech Helps choose most probable “Recognize speech” vs “wreck
Recognition word sequence. a nice beach”.
Machine Chooses grammatically correct “go to school” instead of “to
Translation word order. school go”.
Suggests correction based on “Their going” → “They’re
Spell Checking
context. going”.
Generates more natural Learns common word
Chatbots
sentences. sequences.

Estimating Parameters — Definition

It means calculating the probability of word sequences (like bigrams or


trigrams) from training data.

Formula for Bigram:

P(wn∣wn−1)=Count(wn−1)/Count(wn−1,wn)

🪄 Example:
If “love NLP” = 10 times and “love” = 25 times,

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Sentence: “I love NLP”


Suppose corpus counts are:

 Count(“I love”) = 20
 Count(“love NLP”) = 10
 Count(“love”) = 25

Bigram probability :P(NLP∣love)=Count(love,NLP)/Count(love)


=10/25=0.4P→ 40% chance “NLP” comes after “love”.

2. Problem

Some word pairs may never appear in training data → probability = 0 ❌


That makes the model fail for unseen (new) words or sequences.

3. Smoothing — Definition

Smoothing fixes zero probabilities by giving small nonzero values even to


unseen word combinations.
It “smooths out” the probability distribution.

Common Smoothing Techniques


Type Formula / Idea Meaning
Add-One
w_{n-1}) = \frac{Count(w_{n-
(Laplace) ( P(w_n))
1},w_n)+1}{Count(w_{n-1})+V} )
Smoothing
Same as above but add
Add-k Smoothing small value k<1k < More accurate than +1.
1k<1
Good-Turing Adjusts probability Used in speech recognition.
based on unseen word

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Type Formula / Idea Meaning


counts.
Uses lower-order
Backoff / If trigram unseen → use bigram or
models when data is
Interpolation unigram.
sparse.

Evaluation of a Language Model:

Evaluation of a Language Model means checking how well a model can


predict or generate natural language text.

It measures the accuracy, fluency, and meaningfulness of the sentences produced


by the model.

Simply: It tells how good the model understands and predicts language.

Types of Evaluation
Type Description Example Metric
Directly measures the model’s
1. Intrinsic
performance on a specific language Perplexity, Cross-Entropy
Evaluation
task (like predicting next word).
Measures how the model performs in BLEU (for translation),
2. Extrinsic
a real-world application using the ROUGE (for
Evaluation
language model. summarization)

Multiple Choice Questions (25 × 1 = 25 Marks)


AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

1. Which of the following is a syntactic analysis task in NLP?


A) Part-of-speech tagging
B) Named entity recognition
C) Word sense disambiguation
D) Sentiment analysis
Answer: A

2. Semantics in NLP deals with:


A) Word order
B) Meaning of words and sentences
C) Pronunciation of words
D) Spelling correction
Answer: B

3. Pragmatics in NLP focuses on:


A) Sentence structure
B) Word segmentation
C) Contextual meaning and speaker intention
D) Morphological analysis
Answer: C

4. Which of the following is an issue in NLP?


A) Ambiguity
B) Machine translation
C) Parsing
D) Tokenization
Answer: A

5. Machine learning helps NLP by:


A) Hand-coding grammar rules
B) Automatically learning from data
C) Removing the need for training data
D) Simplifying linguistic theory
Answer: B

6. The probability of a sequence of words is represented in:


A) Parsing tree
B) Language model
C) Syntax graph
D) Grammar rule
Answer: B

7. In probability theory, the sum of all possible outcomes is:


A) 0
B) 1
C) Depends on event
D) Undefined
Answer: B

8. Information theory was developed by:


A) Alan Turing
B) Claude Shannon
C) Noam Chomsky
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

D) Geoffrey Hinton
Answer: B

9. Entropy in information theory measures:


A) Randomness or uncertainty
B) Frequency of words
C) Syntax errors
D) Data compression ratio
Answer: A

10. Collocations are:


A) Random word pairs
B) Words that often occur together
C) Rarely co-occurring words
D) Semantic relations
Answer: B

11. “Strong tea” and “make a decision” are examples of:


A) Collocations
B) Syntax errors
C) Stop words
D) Lemmas
Answer: A

12. An N-gram model predicts:


A) The next character
B) The next word based on previous (n−1) words
C) The next paragraph
D) Sentence boundaries
Answer: B

13. A bigram model considers:


A) One word
B) Two consecutive words
C) Three words
D) Four words
Answer: B

14. Parameter estimation in language models involves:


A) Grammar correction
B) Assigning probabilities to word sequences
C) Removing punctuation
D) Translating text
Answer: B

15. Smoothing in NLP is used to:


A) Handle unseen words or sequences
B) Increase model size
C) Reduce overfitting
D) Segment words
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

16. Laplace smoothing adds:


A) 0
B) 1
C) Frequency count
D) Weighted average
Answer: B

17. Perplexity is used to:


A) Evaluate language models
B) Count N-grams
C) Translate languages
D) Remove stop words
Answer: A

18. Lower perplexity means:


A) Better model
B) Worse model
C) No change
D) More complex model
Answer: A

19. Hidden Markov Models (HMM) are mainly used for:


A) Syntax parsing
B) Sequential labeling tasks like POS tagging
C) Topic modeling
D) Text summarization
Answer: B

20. Which machine learning approach is most used in modern NLP?


A) Rule-based
B) Deep learning
C) Symbolic reasoning
D) Statistical modeling only
Answer: B

21. Tokenization refers to:


A) Splitting text into words or units
B) Removing punctuation
C) Parsing syntax trees
D) Semantic tagging
Answer: A

22. POS tagging is an example of:


A) Syntax-level task
B) Pragmatic-level task
C) Phonetic-level task
D) Semantic-level task
Answer: A

23. The chain rule of probability is used in:


A) N-gram modeling
B) Syntactic parsing
C) Collocation detection
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

D) Text segmentation
Answer: A

24. Mutual information is used to:


A) Find association strength between words
B) Estimate perplexity
C) Remove redundant words
D) Parse dependency trees
Answer: A

25. A unigram model assumes:


A) Each word is independent of previous words
B) Each word depends on all prior words
C) Only bigrams matter
D) The last word is repeated
Answer: A

🌿 Section B: 5-Mark Questions (Answer any 5 × 5 = 25 Marks)

1. Explain the difference between syntax, semantics, and pragmatics in NLP with suitable
examples.
2. What are the major issues and challenges in Natural Language Processing?
3. Describe the role of machine learning in NLP applications.
4. Explain the basics of probability theory as applied in NLP.
5. Define collocations. Discuss their importance in NLP with examples.
6. What is smoothing in language modeling? Describe Laplace smoothing.

🌿 Section C: 10-Mark Questions (Answer any 6 × 10 = 60 Marks)

1. Describe in detail the applications of NLP in real-world systems (e.g., chatbots,


sentiment analysis, translation).
2. Explain N-gram language models. Derive the probability estimation for bigram and
trigram models with examples.
3. Discuss the concept of Information Theory and its relevance to NLP. Include entropy
and mutual information.
4. Explain the process of evaluating language models. Discuss metrics like perplexity and
cross-entropy.
5. Discuss parameter estimation techniques in statistical language modeling and their
challenges.
6. Describe how machine learning and deep learning techniques have transformed modern
NLP, giving examples of architectures and tasks.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Unit 2

Word leveland Syntactic Analysis

Word Level Analysis: Regular Expressions-Finite-State Automata-


Morphological Parsing-Spelling Error Detectionand correction-Words and
Word classes-Part-ofSpeechTagging. Syntactic Analysis: Context-free
Grammar-Constituency- ParsingProbabilistic Parsing.

Word Level Analysis :


Definition:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Word Level Analysis in NLP refers to the process of analyzingindividual words


in a text to understand their structure, meaning, and role in a sentence.
It is the first step after tokenization in many NLP pipelines.

Main Tasks in Word-Level Analysis:


Task Definition Example
Splitting a sentence into “I love NLP” → [“I”, “love”,
1. Tokenization
individual words (tokens). “NLP”]
Converting words to their
2. Lemmatization base or dictionary form “running”, “ran” → “run”
(lemma).
Trimming words to their
3. Stemming root form (not always a “playing”, “played” → “play”
valid word).
4. Part-of-Speech Identifying the grammatical “She eats apple” → eats/VB,
(POS) Tagging category of each word. apple/NN
“Google is in California.” →
5. Named Entity Detecting names of people,
Google = ORG, California =
Recognition (NER) places, organizations, etc.
LOC
6. Morphological Studying word structure “Unhappiness” → prefix=un,
Analysis (prefix, suffix, root). root=happy, suffix=ness

Real-Time Example:

Sentence: “John is playing football.”

 Tokens → [“John”, “is”, “playing”, “football”]


 Lemmas → [“John”, “be”, “play”, “football”]
 POS Tags → [NOUN, VERB, VERB, NOUN]

Applications:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Text preprocessing for machine learning models


 Sentiment analysis
 Spell checking and grammar correction
 Machine translation

Regular Expressions (RegEx)


Definition:
Regular Expressions are patterns used to search, match, or manipulate
text in [Link] describe a set of strings that follow a particular pattern.
Concepts:

 Literal characters: Match exact characters (e.g., “cat” → matches “cat”).


 Metacharacters: Special symbols (like ., *, +, ?, [], ^, $) used for
pattern rules.
 Groups and ranges: Allow matching sets or sequences of characters.

Types:

1. Basic RegEx: Simple string matching ("NLP", "data").


2. Extended RegEx: Includes advanced patterns (e.g., \d+, \w*, .*ing).
3. Compound RegEx: Combining multiple expressions.

Real-Time Example:

 Email validation:
Pattern → [a-zA-Z0-9._]+@[a-z]+\.[a-z]+
Matches: nithya123@[Link]
 Extracting phone numbers:
Pattern → \d{10} → Matches 9876543210

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Finite-State Automata (FSA)


Definition:

A Finite-State Automaton is a mathematical model used to represent and


recognize patterns or sequences in [Link] consists of states and
transitions between those states based on inputs.

Concepts:

 States: Conditions or stages (start, accept, reject).


 Transitions: Movement between states when reading symbols.
 Alphabet: Set of symbols the automaton reads (like letters).

Types:

1. Deterministic Finite Automata (DFA): Only one possible path for each
input.
2. Non-Deterministic Finite Automata (NFA): Multiple paths possible.

Real-Time Example:

 Spell checkers use FSA to detect valid words.


 For the word “cats”:
c → a → t → s (Each letter transition forms a valid path).

Morphological Parsing:

Definition:

Morphological Parsing is the process of breaking a word into its morphemes


(smallest meaningful parts) — like root words, prefixes, and suffixes.

Concepts:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Morpheme: Smallest unit of meaning.


 Root: Main meaning part (e.g., “happy”).
 Affix: Added part (e.g., prefix “un-”, suffix “-ness”).

Types:

1. Inflectional Morphology: Changes word form (e.g., “play → plays”).


2. Derivational Morphology: Creates new words (e.g., “happy →
happiness”).

Real-Time Example:

 “unhappiness” = un (prefix) + happy (root) + ness (suffix).


Used in search engines for stemming and lemmatization.

Spelling Error Detection and Correction

Definition:

Detecting and correcting spelling mistakes in text using algorithms and linguistic
rules.

Concepts:

Error types:

o Insertion: Extra letters (e.g., “speling”).


o Deletion: Missing letters (e.g., “recieve”).
o Substitution: Wrong letters (e.g., “teh” for “the”).

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

o Transposition: Letters swapped (e.g., “hte” for “the”).

Methods / Types:

1. Edit Distance (Levenshtein): Minimum number of edits to fix a word.


2. Soundex Algorithm: Corrects based on pronunciation.
3. Dictionary-based correction: Compares with valid words list.

Real-Time Example:

Typing “recieve” → auto-corrects to “receive” on Google Docs or MS Word.

Words and Word Classes

Definition:

Word classes (or Parts of Speech) group words based on their grammatical role
in a sentence.

Types:
Class Example Function
Noun cat, student Names a person/place/thing
Verb run, write Shows action
Adjective tall, red Describes noun
Adverb quickly, very Describes verb
Pronoun he, they Replaces noun
Preposition in, on Shows relation
Conjunction and, but Joins words/clauses
Interjection oh!, wow! Expresses emotion

Real-Time Example:
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Sentence: “The tall boy runs fast.”

 The (Det), tall (Adj), boy (Noun), runs (Verb), fast (Adverb)

Part-of-Speech (POS) Tagging:

Definition:
Process of assigning each word a grammatical label (POS tag) such as
noun, verb, or adjective.

Concepts:

 Helps computers understand sentence structure and meaning.


 Uses grammar rules or trained models.

Types:

1. Rule-based POS Tagging


2. Statistical POS Tagging (HMM, CRF)
3. Neural POS Tagging (BiLSTM, Transformer)

Real-Time Example:

Sentence: “She plays football.”


→ She/PRON, plays/VERB, football/NOUN
Used in Google Translate and chatbots.

Context-Free Grammar (CFG)

Definition:
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

A grammar system where rules define how words and phrases combine
to form valid sentences.

Concepts:

 Non-terminal symbols: Categories (e.g., NP = Noun Phrase).


 Terminal symbols: Actual words (e.g., “apple”, “boy”).
 Production rules: Define structure (S → NP VP).

Real-Time Example:

Sentence: “The boy eats apple.”


Rules:

S → NPVP

NP → DetN

VP → VNP
Det → The
N → boy|apple
V → eats

Used in syntax checkers and compilers.

Constituency

Definition:

Constituency represents how words group into phrases that act as single units
(constituents).

Concepts:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Constituent: Group of words functioning as a unit (e.g., Noun Phrase).


 Tree structure: Shows hierarchy of phrases.

Real-Time Example:

Sentence: “The young boy plays football.”

 [The young boy] → Noun Phrase


 [plays football] → Verb Phrase

Used in parse tree generation.

Parsing

Definition:

Parsing means analyzing sentence structure based on grammar to produce a parse


tree.

Types:

1. Top-down Parsing: Starts from root (S → ...)


2. Bottom-up Parsing: Starts from words and builds up.
3. Dependency Parsing: Focuses on word-to-word relations.

Real-Time Example:

Sentence: “The boy eats apple.”


Parse Tree:
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

S
├── NP → The boy
└── VP → eats apple

Used in grammar checkers and NLP syntax analyzers.

Probabilistic Parsing:

Definition:

Probabilistic Parsing uses probabilities for grammar rules to choose the most
likely structure for a sentence.

Concepts:

 Based on PCFG (Probabilistic Context-Free Grammar).


 Each rule has a probability (based on training data).
 Helps disambiguate sentences with multiple meanings.

Real-Time Example:

Sentence: “I saw the man with the telescope.”

 Could mean I used a telescope, or the man had one.


Probabilistic parser chooses the more likely interpretation based on corpus
data.

Multiple Choice Questions (25 × 1 = 25 Marks)

 1. Regular expressions are mainly used in NLP for:


A) Parsing syntax trees
B) Word pattern matching and text search
C) Generating parse trees
D) Sentence segmentation
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 2. Which of the following is a basic building block of regular expressions?


A) Grammar rules
B) Finite automata
C) Alphabet and operators (*, |, +)
D) Parse trees
Answer: C

 3. A finite-state automaton (FSA) is used to:


A) Generate and recognize regular languages
B) Detect syntax errors
C) Translate natural languages
D) Parse context-free grammars
Answer: A

 4. In NLP, an FSA processes:


A) Words
B) Sentences
C) Sound waves
D) Parsing trees
Answer: A

 5. Morphological parsing involves:


A) Breaking words into morphemes
B) Detecting sentence boundaries
C) Parsing context-free grammar
D) Translating languages
Answer: A

 6. A morpheme is:
A) The smallest unit of sound
B) The smallest meaningful unit in a word
C) A syntactic phrase
D) A type of POS tag
Answer: B

 7. The term stemming refers to:


A) Removing stop words
B) Reducing words to their root or stem form
C) Detecting named entities
D) Tagging words by part of speech
Answer: B

 8. Which algorithm is commonly used for stemming in English?


A) HMM
B) Porter Stemmer
C) Edit Distance
D) Naïve Bayes
Answer: B
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 9. A common approach to spelling error detection uses:


A) Parse trees
B) Confusion sets and edit distance
C) Context-free grammar
D) FSTs only
Answer: B

 10. The edit distance measures:


A) Similarity between two words
B) Word frequency
C) Word length
D) Parsing depth
Answer: A

 11. The minimum number of operations (insertions, deletions, substitutions) to convert


one word into another is known as:
A) Hamming distance
B) Edit distance
C) Cosine similarity
D) Tokenization distance
Answer: B

 12. Words and word classes are grouped based on:


A) Phonetics
B) Meaning and usage in sentences
C) Sound patterns
D) Capitalization rules
Answer: B

 13. Which of the following is an example of a closed-class word?


A) Noun
B) Verb
C) Pronoun
D) Adjective
Answer: C

 14. Part-of-Speech (POS) tagging assigns:


A) Syntactic trees to sentences
B) Word categories like noun, verb, adjective
C) Meaning representations
D) Morphemes to words
Answer: B

 15. POS tagging is a task at which level of NLP analysis?


A) Phonetic level
B) Word level
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

C) Semantic level
D) Pragmatic level
Answer: B

 16. Which model is widely used for probabilistic POS tagging?


A) Finite-state automata
B) Hidden Markov Model (HMM)
C) Context-Free Grammar
D) Word2Vec
Answer: B

 17. A context-free grammar (CFG) is composed of:


A) Rules, terminals, nonterminals, and a start symbol
B) Only nonterminals
C) Sound patterns
D) Semantic roles
Answer: A

 18. A parse tree represents:


A) Morphological structure of words
B) Syntactic structure of a sentence
C) Semantic meaning of phrases
D) POS tagging results
Answer: B

 19. Constituency refers to:


A) Grouping words into hierarchical structures
B) Classifying words by semantics
C) Tagging named entities
D) Translating text
Answer: A

 20. The rule S → NP VP is an example of:


A) Probabilistic grammar
B) Context-free grammar rule
C) Morphological rule
D) Word formation rule
Answer: B

 21. In syntactic parsing, ambiguity occurs when:


A) A sentence can have multiple valid parse trees
B) Words are misspelled
C) A sentence lacks a verb
D) Morphology fails
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 22. A top-down parser starts parsing from:


A) Words
B) The start symbol (S)
C) The leaves of the tree
D) POS tags
Answer: B

 23. A bottom-up parser starts parsing from:


A) The start symbol
B) Words (input tokens)
C) The top node
D) Rules only
Answer: B

 24. In probabilistic parsing, probabilities are assigned to:


A) Morphemes
B) Grammar rules
C) POS tags only
D) Sound patterns
Answer: B

 25. A Probabilistic Context-Free Grammar (PCFG) helps to:


A) Choose the most likely parse tree for a sentence
B) Detect spelling errors
C) Tag words with POS
D) Segment text into morphemes
Answer: A

Section B: 5-Mark Questions (Answer any 5 × 5 = 25 Marks)

1. Explain the use of regular expressions in word-level analysis in NLP. Give suitable
examples.
2. What is finite-state automata (FSA)? How is it used in word recognition and
morphological analysis?
3. Define morphological parsing. Explain how it helps in analyzing word structure.
4. Discuss the common techniques used in spelling error detection and correction.
5. What are word classes? Explain the importance of Part-of-Speech (POS) tagging in
NLP.
6. Write short notes on constituency and context-free grammar in syntactic analysis.

🌿 Section C: 10-Mark Questions (Answer any 6 × 10 = 60 Marks)

1. Describe in detail the role of regular expressions and finite-state automata in word-
level analysis. Explain with examples.
2. Discuss the process of morphological parsing. Explain how FSAs and finite-state
transducers (FSTs) are used for morphological analysis in NLP.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

3. Explain the methods of spelling error detection and correction. Compare edit
distance and probabilistic approaches with suitable examples.
4. Describe the different word classes and explain how Part-of-Speech tagging is
performed using probabilistic models such as the Hidden Markov Model (HMM).
5. Explain Context-Free Grammar (CFG) and its role in syntactic parsing. Provide
examples of CFG rules and parse trees.
6. What is probabilistic parsing? Explain how it differs from deterministic parsing, and
describe how Probabilistic Context-Free Grammars (PCFGs) improve parsing
accuracy.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Unit 3

SemanticanalysisandDiscourseProcessing

Semantic Analysis: Meaning Representation-Lexical Semantics-


Ambiguity-Word Sense Disambiguation. Discourse Processing: cohesion-
Reference Resolution- Discourse Coherence and Structure.

Semantic Analysis in NLP

Definition:
Semantic Analysis in Natural Language Processing (NLP) is the process of
understanding the meaning of words, phrases, and sentences in context. It goes
beyond the structure (syntax) and focuses on what the text actually means.

Key Concept:

Semantic analysis tries to make the machine understand “what the user intended
to say”, not just “what the words are.”

⚙️Types of Semantic Analysis:


Type Description Example
1. Lexical Study of word meanings and “Big” and “Large” are
Semantics relationships between words. synonyms.
Determines how meanings of “John ate an apple” → John
2. Compositional
individual words combine to (subject) performs action
Semantics
form sentence meaning. (eat) on apple (object).

Core Concepts in Semantic Analysis:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

1. Word Sense Disambiguation (WSD):


Choosing the correct meaning of a word based on context.
🧠 Example: “Bank” → river bank 🌊 or financial bank 🏦?

2. Semantic Role Labeling (SRL):


Identifies “who did what to whom.”
🧠 Example: “Mary gave John a book.”
o Mary = giver (agent)
o John = receiver (recipient)
o Book = thing given (theme)

3. Named Entity Recognition (NER):


Detects proper names like people, places, or organizations.
🧠 Example: “Google was founded in California.”
o Google → Organization
o California → Location

4. Coreference Resolution:
Finds when two or more words refer to the same entity.
🧠 Example: “Nithya loves her students. She teaches them NLP.”
→ “She” = “Nithya”

Real-Time Examples:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Voice Assistants: Understanding your command like “Play my favorite


song.”
 Chatbots: Extracting meaning from user messages for accurate replies.
 Search Engines: Interpreting intent behind queries (e.g., “apple price” →
phone or fruit?)
 Sentiment Analysis: Understanding emotional meaning behind text.

Meaning Representation:

Definition:

Meaning Representation refers to the process of expressing the meaning


of a sentence or word in a structured, machine-understandable form.
It helps computers understand what the sentence actually means, not just the
words.

Concept:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 It converts natural language → logical / semantic form (like symbols or


graphs).
 Used for question answering, reasoning, and dialogue systems.
 It represents entities, actions, relationships, and attributes.

Example:

Sentence: “Ram eats an apple.”


Meaning Representation (in logic form):

EAT(Ram, Apple)

Here, EAT is the action, and Ram, Apple are the entities (subject & object).

Real-Time Example:

When you ask Siri: “Who is the president of India?”


→ NLP converts your question into a meaning representation like

president_of(India, ?x)

→ Then it searches and finds the answer “DroupadiMurmu”.

Lexical Semantics

Definition:

Lexical Semantics is the study of word meanings and their relationships.


It helps NLP understand how words are related, such as synonyms, antonyms,
polysemy (multiple meanings), etc.

Concepts include:
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Synonymy: same meaning (e.g., big – large)


 Antonymy: opposite meaning (e.g., hot – cold)
 Polysemy: one word, many meanings (e.g., bank → river bank / financial
bank)
 Homonymy: same spelling, unrelated meanings (e.g., bat → animal /
cricket bat)
 Hyponymy: category relationship (e.g., rose is a flower)

Example:

Sentence: “The bank is near the river.”


→ NLP must use lexical semantics to know that bank means riverbank, not
financial bank.

Real-Time Example:

In Google Translate or ChatGPT, understanding whether “light” means not


heavy or illumination depends on lexical semantics.

Difference Summary:
Concept Focus Example
Meaning “Ram eats an apple” →
Sentence-level meaning
Representation EAT(Ram, Apple)
Word-level meaning and bank → river side / financial
Lexical Semantics
relation institution

Ambiguity in Semantic Analysis – NLP

Definition:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Ambiguity means a sentence or word having more than one possible


[Link] Analysis, ambiguity occurs when a word, phrase, or
sentence can be interpreted in multiple ways — making it hard for the
computer to find the correct meaning.

Types of Ambiguity in NLP:

Lexical Ambiguity

 When one word has multiple meanings.


 NLP must choose the right sense based on context.

Example:

“He went to the bank.”


👉Bank = financial institution or river bank?
🧠 Context helps decide.

Syntactic Ambiguity

 Caused by different grammatical structures giving different meanings.

Example:

“I saw the man with a telescope.”


👉 Did I use the telescope? Or did the man have it?

Semantic Ambiguity

 Even when structure is clear, the overall meaning can still be confusing.

Example:

“Visiting relatives can be annoying.”


👉 Does it mean relatives who visit are annoying
or the act of visiting relatives is annoying?

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Pragmatic Ambiguity

 Occurs when context or intention changes meaning.

Example:

“Can you pass the salt?”


👉Literally a question about ability, but really a request.

Why Ambiguity Important in NLP:

Ambiguity affects:

 Machine Translation
 Speech Recognition
 Chatbots& Q&A systems
 Information Retrieval

If NLP doesn’t resolve ambiguity correctly, the output meaning will be wrong.

How NLP Handles Ambiguity:

1. Word Sense Disambiguation (WSD) → to choose the right word meaning


2. Context Analysis → uses neighboring words
3. Probabilistic Models → assigns likelihood to meanings
4. Semantic Role Labeling → identifies roles like subject, object, verb

✅Example Table

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Correct
Type Example Ambiguity
Meaning
bank → river / depends on
Lexical “He went to the bank.”
money context
“I saw the man with a who has the
Syntactic structure-based
telescope.” telescope?
“Visiting relatives can be
Semantic who is annoying? meaning-based
annoying.”
Pragmatic “Can you pass the salt?” question or request? context-based

Word Sense Disambiguation (WSD) in NLP

Definition:

Word Sense Disambiguation (WSD) is the process of


determining which meaning (sense) of a word is used in a given
[Link] simple terms: it helps computers understand the correct
meaning of a word that has multiple meanings based on how it’s
used in a sentence.

Example:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Ambiguous
Sentence Correct Sense
Word
I went to the bank to deposit financial
bank
money. institution
He sat on the bank of the river. bank side of a river

➡️The word “bank” has two meanings — WSD helps identify which
one is intended.

🧩 Need for WSD:

 Many words in English (and other languages) have multiple


meanings (polysemy).
 To make NLP applications like machine translation,
information retrieval, or chatbots accurate, we must understand
the right meaning.

Approaches / Methods:
1. Knowledge-based Approaches

Use dictionaries, thesauri, or semantic networks (like WordNet).

 Lesk Algorithm: Finds overlap between dictionary definitions


and context words.
 Semantic Similarity: Chooses the sense that is most semantically
related to surrounding words.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🧠 Example:
In “He dropped his line in the water,” the sense of “line” related to
fishing is chosen, not telephone line.

2. Supervised Machine Learning Approaches

Train a model on labeled datasets (where correct senses are known).


Common algorithms: Decision Trees, Naive Bayes, SVM.

🧠 Example:
If training data shows that “river” co-occurs with bank (river) and
“money” with bank (financial), the model learns to classify correctly.

3. Unsupervised Approaches

No labeled data — the system clusters word occurrences based on


context similarity.
Each cluster represents a different meaning.

🧠 Example:
Occurrences of “bank” with “money,” “loan,” “cash” go to one cluster;
those with “river,” “water” go to another.

4. Deep Learning / Contextual Embedding Approaches

Modern models like BERT, GPT, etc., use contextual embeddings —


the model automatically understands the correct sense of a word from
context.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🧠 Example:
BERT gives different vector meanings for “bank” in both sentences
automatically.

📚Applications of WSD:
Application Description
Machine Choosing correct translation based on sense (e.g.,
Translation “pen” = writing tool or animal enclosure).
Information Returns relevant documents for the intended
Retrieval meaning.
Speech and
Understands user intent correctly.
Chatbots
Text Helps in generating accurate summaries by
Summarization understanding context.

Summary Table:
Aspect Description
Definition Identifying correct meaning of a word in context
Example “Bank” = money place / river side
Need To remove ambiguity
Knowledge-based, Supervised, Unsupervised, Deep
Approaches
Learning
Applications MT, IR, Chatbots, Summarization

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Discourse Processing in NLP

Definition:

Discourse Processing is the study of how sentences in a text or


conversation are connected and make sense together — not just individually.
It deals with understanding language beyond the sentence level.

It helps computers understand how multiple sentences combine to form


meaningful paragraphs, conversations, or documents.

Concept:

While syntax and semantics handle individual sentences,


discourse processing focuses on relationships between sentences — such as
context, reference, topic continuity, and coherence.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Tasks in Discourse Processing:


Task Explanation Example
“Nithya bought a car. She
1. Coreference Finding which words refer to the
loves it.” → “She” →
Resolution same entity.
Nithya; “it” → car
“It rained heavily. The
2. Discourse Ensuring the text flows logically
match was cancelled.”
Coherence from one sentence to another.
(cause–effect relation)
Identifying how sentences or
3. Discourse News articles: headline →
paragraphs are organized
Structure Analysis background → details
(introduction, reason, result, etc.).
4. Dialogue Act Understanding the purpose of an “Can you pass the salt?”
Recognition utterance in a conversation. → request, not a question
5. Topic Detecting where the topic Topic shift: from
Segmentation and changes in a long text or “weather” to “sports” in a
Tracking conversation. chat
6. Anaphora Resolving pronouns or “The boy fell because he
Resolution references. tripped.” (“he” → “boy”)

Techniques Used:

1. Rule-based methods – using linguistic rules (e.g., pronoun resolution


rules).
2. Machine Learning models – trained on annotated discourse datasets.
3. Deep Learning (Transformer models) – BERT, GPT, etc., for contextual
understanding.
4. Rhetorical Structure Theory (RST) – identifies relationships like
“cause,” “contrast,” “elaboration,” etc., between sentences.

Applications:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 Text summarization (to maintain coherence)


 Dialogue systems / chatbots (to understand context in conversation)
 Question answering systems
 Machine translation (to preserve references and flow)
 Sentiment analysis (contextual sentiment across sentences)

Simple Real-Time Example:

Text:

“John went to the restaurant. He ordered pasta because he was hungry.”

Discourse understanding:

 “He” → refers to “John” (Coreference resolution)


 “Because” → signals cause (Coherence relation)
 Together → both sentences form one meaningful event chain.

Cohesion in Discourse Processing

Definition:

Cohesion refers to the grammatical and lexical connections that link


sentences together in a text or [Link] ensures that the text “sticks
together” and flows naturally.

Cohesion is what makes sentences in a paragraph connected through words,


pronouns, and structure.

Example:

“Ravi bought a new phone. He likes it very much.”

Here —

 “He” → refers to “Ravi” (pronoun reference)

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

 “It” → refers to “phone”


These links make the sentences cohesive and meaningful together.

Without cohesion:

“Ravi bought a new phone. The phone is liked by Ravi.”


(Still clear, but less natural — weaker cohesion.)

Types of Cohesion:
Type Explanation Example
Using pronouns or demonstratives to “Ravi saw a dog. It was
1. Reference
refer to earlier words. barking.”
Replacing a word with another to “I need a pen. Do you
2. Substitution
avoid repetition. have one?”
Omitting words that can be understood “She likes apples, and he
3. Ellipsis
from the context. [likes] bananas.”
Using connecting words (and, but, “It was raining, so we
4. Conjunction
because, so) to show logical relation. stayed inside.”
5. Lexical Repetition or using related words with “The car was fast. That
Cohesion similar meaning. vehicle won the race.”

Why Cohesion Important in NLP:

Cohesion helps NLP systems understand context and relationships between


sentences — essential for:

 Text summarization
 Machine translation
 Discourse analysis
 Dialogue understanding

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

For example:
In summarization, identifying cohesive ties helps pick key sentences that connect
the main ideas.

Difference between Cohesion and Coherence


Aspect Cohesion Coherence
Surface-level links between
Logical flow and overall sense of the
Definition sentences using grammar and
text
vocabulary
Focus Linguistic connection Meaning connection
“Ravi bought a car. He is tall.”
“Ravi bought a car. He likes it.”
Example (cohesive words, but not meaningful
(connected grammatically)
link → poor coherence)

What is Discourse in NLP?

In NLP (Natural Language Processing), discourse refers to a sequence of


sentences or utterances that together form a meaningful text or conversation.
It goes beyond single sentences — focusing on how sentences connect to express
complete ideas, arguments, or stories.

🟢 Example:

> Sentence 1: John bought a new car.


Sentence 2: He drives it to work every day.

Here, “He” refers to John and “it” refers to car — both sentences are connected.
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

That connection is part of discourse coherence.

🧩 2. What is Discourse Coherence?

Coherence means that the text or conversation “makes sense as a whole.”


It ensures that ideas are logically and semantically connected.

🔹 Types of Coherence:

1. Referential Coherence – How entities are tracked across sentences.


→ “Mary lost her keys. She searched everywhere.” (Mary = She)

2. Lexical Coherence – Using related words to maintain a theme.


→ “The weather is hot. The sun is blazing.”

3. Temporal Coherence – Logical order of events.


→ “He entered the room, then closed the door.”

4. Causal Coherence – Cause–effect relationships.


→ “It rained heavily, so the match was canceled.”

🏗️ 3. What is Discourse Structure?

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Discourse structure represents how sentences and paragraphs are organized to


form a coherent text.

It involves:

Hierarchy of relations (main ideas vs. supporting ideas)

Discourse relations such as:

Contrast (but, however)

Elaboration (in addition, for example)

Cause (because, therefore)

Condition (if, unless)

🧠 4. Theories and Models of Discourse Structure

1. Rhetorical Structure Theory (RST)

Developed by Mann & Thompson.

Describes texts as a tree of nucleus (main idea) and satellite (supporting idea)
relations.

Example:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

“He was tired because he worked all night.”


→ Cause relation (work → tiredness)

2. Centering Theory

Focuses on discourse entities (like people or objects) and how attention shifts
between them in a conversation.

Helps in pronoun resolution (“he,” “she,” “it”).

3. Discourse Representation Theory (DRT)

Builds semantic models across sentences to represent meaning and resolve


references.

Multiple Choice Questions (25 × 1 = 25 Marks)

1. Semantic analysis in NLP deals with:


A) Sentence structure
B) Meaning of words and sentences
C) Sound patterns
AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

D) Morphological parsing
Answer: B

2. Meaning representation in NLP aims to:


A) Translate sentences syntactically
B) Represent the meaning of text in a formal structure
C) Detect errors in grammar
D) Perform word segmentation
Answer: B

3. A common formalism used for meaning representation is:


A) Context-Free Grammar
B) Predicate Logic
C) Finite-State Automata
D) Regular Expressions
Answer: B

4. The smallest unit of meaning in lexical semantics is called:


A) Phoneme
B) Morpheme
C) Lexeme
D) Token
Answer: C

5. Lexical semantics focuses on:


A) Sound systems
B) Meaning relationships among words
C) Sentence parsing
D) Speech recognition
Answer: B

6. Synonymy refers to:


A) Words with opposite meanings
B) Words with similar meanings
C) Words with multiple meanings
D) Words that sound alike
Answer: B

7. Antonymy means:
A) Similar words
B) Opposite words

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

C) Related words
D) Derived words
Answer: B

8. Ambiguity in NLP occurs when:


A) A sentence has only one meaning
B) A sentence or word can have multiple interpretations
C) Grammar is incorrect
D) Syntax is missing
Answer: B

9. The word “bank” (river bank / financial bank) is an example of:


A) Syntactic ambiguity
B) Lexical ambiguity
C) Semantic anomaly
D) Phonological ambiguity
Answer: B

10. Word Sense Disambiguation (WSD) is the process of:


A) Detecting sentence boundaries
B) Determining the correct meaning of a word based on context
C) Identifying parts of speech
D) Translating between languages
Answer: B

11. A popular algorithm for Word Sense Disambiguation is:


A) Porter Stemmer
B) Lesk Algorithm
C) Earley Parser
D) Viterbi Algorithm
Answer: B

12. Which of the following uses dictionary definitions for WSD?


A) Supervised learning
B) Lesk algorithm
C) Hidden Markov Model
D) Neural embeddings
Answer: B

13. Discourse processing in NLP deals with:


A) Sentence structure

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

B) Understanding text beyond single sentences


C) Tokenization
D) POS tagging
Answer: B

14. Cohesion in discourse refers to:


A) Logical connection of ideas across sentences
B) Grammar rules
C) Morphological variation
D) Phonetic similarity
Answer: A

15. Reference resolution means:


A) Identifying relationships between morphemes
B) Determining which entity a pronoun or noun phrase refers to
C) Translating idioms
D) Parsing syntactic structures
Answer: B

16. The sentence “John went home because he was tired.” — “he” refers to John. This is an
example of:
A) Ellipsis
B) Reference resolution
C) Ambiguity
D) Cohesion
Answer: B

17. Anaphora resolution is a subtask of:


A) POS tagging
B) Reference resolution
C) Semantic parsing
D) Morphological analysis
Answer: B

18. Discourse coherence ensures:


A) Logical and meaningful flow between sentences
B) Grammar correctness
C) Word sense resolution
D) Parsing accuracy
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

19. Discourse structure represents:


A) The hierarchical or relational organization of text
B) Word-level dependencies
C) Phonetic organization
D) Semantic ambiguity
Answer: A

20. Which theory describes discourse relations like contrast, elaboration, and cause?
A) Dependency Grammar
B) Rhetorical Structure Theory (RST)
C) Context-Free Grammar
D) Predicate Logic
Answer: B

21. Co-reference resolution helps in:


A) Identifying that two expressions refer to the same entity
B) Tagging parts of speech
C) Building parse trees
D) Translating words
Answer: A

22. “Mary saw herself in the mirror.” — “herself” refers to Mary. This is:
A) Cataphora
B) Reflexive anaphora
C) Ellipsis
D) Deixis
Answer: B

23. Which approach uses neural networks for discourse processing?


A) Symbolic reasoning
B) Deep learning-based coreference models
C) Context-free parsing
D) Statistical smoothing
Answer: B

24. Semantic role labeling (SRL) assigns:


A) Meaning to entire texts
B) Roles like agent, patient, and instrument to sentence components
C) POS tags to words
D) Pronoun antecedents
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

25. The main goal of discourse analysis is:


A) Identify single-word meanings
B) Understand relationships and meaning across sentences
C) Detect grammar errors
D) Generate parse trees
Answer: B

✅ Answer Key Summary


1-B | 2-B | 3-B | 4-C | 5-B | 6-B | 7-B | 8-B | 9-B | 10-B |
11-B | 12-B | 13-B | 14-A | 15-B | 16-B | 17-B | 18-A | 19-A | 20-B |
21-A | 22-B | 23-B | 24-B | 25-B

🌿 Section B: 5-Mark Questions (Answer any 5 × 5 = 25 Marks)

1. Explain meaning representation in semantic analysis. What are its main approaches?
2. Define lexical semantics. Describe its role in understanding word meaning.
3. What is ambiguity in NLP? Explain its types with examples.
4. Define Word Sense Disambiguation (WSD). How does it help in NLP applications?
5. What is cohesion in discourse processing? Give suitable examples.
6. Explain the concept of reference resolution with an example sentence.

🌿 Section C: 10-Mark Questions (Answer any 6 × 10 = 60 Marks)

1. Discuss in detail the various approaches to meaning representation in semantic


analysis.
2. Explain lexical semantics and describe the relationships among words such as
synonymy, antonymy, and polysemy.
3. Describe Word Sense Disambiguation (WSD) techniques — knowledge-based,
supervised, and unsupervised approaches.
4. Explain discourse processing and its components — cohesion, coherence, and
discourse structure.
5. Discuss reference resolution and its types: anaphora, cataphora, and coreference, with
examples.
6. Describe the role of Discourse Coherence and Rhetorical Structure Theory (RST) in
understanding connected text.

Unit 4
NaturalLanguageGeneration

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

ArchitectureofNLG Systems- GenerationTasks and Representations-


ApplicationofNLG. Machine Translation: Problems in Machine Translation.
Characteristics of Indian Languages- Machine Translation Approaches-
Translation involving Indian Languages.

Natural Language Generation (NLG) – Overview

Definition:
Natural Language Generation (NLG) is a subfield of Natural Language
Processing (NLP) that focuses on automatically producing human-like text from
structured or unstructured data.

Example:
Input data: Temperature = 32°C, Weather = Sunny
Output (NLG): “It is a sunny day with a temperature of 32 degrees Celsius.”

Architecture of NLG System

An NLG system typically consists of six main stages (sometimes grouped into
three).
Each stage converts data into more natural and readable text.

🧩 1. Content Determination

Purpose: Decide what information should be included in the text.

The system selects relevant facts from input data.

Example: From weather data, pick temperature and condition (ignore wind speed

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

if not needed).

🧩 2. Document Structuring

Purpose: Organize selected information into a logical structure or order.

Determines how information is grouped and sequenced.

Example:

Paragraph 1 → Weather summary

Paragraph 2 → Forecast details

🧩 3. Sentence Aggregation

Purpose: Combine related pieces of information into single, concise sentences.

Example:

Before: “The temperature is 32°C. The weather is sunny.”

After aggregation: “It is a sunny day with a temperature of 32°C.”

🧩 4. Lexicalization

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Purpose: Choose appropriate words or phrases to express selected information.

Example:

Data: Temperature = High

Lexical choice: “hot” instead of “high temperature value.”

🧩 5. Referring Expression Generation

Purpose: Decide how to refer to entities (use pronouns, definite/indefinite nouns).

Example:

“John entered the room. He sat down.” (refers to John)

Avoid repetition while maintaining clarity.

🧩 6. Linguistic Realization

Purpose: Generate grammatically correct and fluent sentences.

Applies syntax rules, morphology, and punctuation.

Example:

Template-based: “The temperature is {value}°C.”

Becomes: “The temperature is 32°C.”

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Introduction

Natural Language Generation (NLG) is a subfield of Natural Language


Processing (NLP) concerned with producing natural language text from non-
linguistic data or machine representations.

It focuses on what to say and how to say it — turning structured information into
fluent, meaningful sentences.

🧩 2. Generation Tasks

NLG systems perform several key tasks during text generation.


These tasks transform input data step-by-step into natural language output.

🔹 1. Content Determination

Goal: Decide what information should be expressed in the output.

The system selects the most important or relevant facts from input data.

Example:
Data = {Temperature: 32°C, Weather: Sunny, Wind: Low}
→ Output should include only “Temperature” and “Weather.”

🔹 2. Text Planning / Document Structuring

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Goal: Organize selected information into a logical sequence.

Determines order, grouping, and overall structure of the text.

Example:

Paragraph 1 → Current weather

Paragraph 2 → Forecast

🔹 3. Sentence Planning

This stage includes three sub-tasks:

a. Sentence Aggregation – Combine related data into one sentence.


→ “It is sunny and 32°C.”

b. Lexicalization – Choose appropriate words or phrases.


→ “High temperature” instead of “Temperature = 32°C.”

c. Referring Expression Generation – Select words like pronouns or definite


nouns.
→ “John went home. He was tired.

🔹 4. Surface Realization

Goal: Convert sentence plans into grammatically correct text.

Applies syntax, morphology, and punctuation rules.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example:
Template → “The temperature is {value}°C.”
Realized text → “The temperature is 32°C.”

🔹 5. Revision / Evaluation

Some systems also include a revision step to check for fluency, coherence, and
grammatical errors before final output.

🧠 3. Generation Representations

In NLG, representations are the internal data structures that describe the
information to be converted into text.
They bridge the gap between raw data and final sentences.

🔸 Types of Representations:

1. Semantic Representation

Describes meaning or intent of the message.

Used in systems that generate text from knowledge bases or ontologies.

Example:

(weather
(type sunny)
(temperature 32°C))

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

2. Syntactic Representation

Represents grammatical structure (nouns, verbs, phrases).

Example:
(S (NP The weather) (VP is (ADJP sunny)))

3. Discourse Representation

Represents relationships between sentences (contrast, cause, elaboration).

Example:
“It rained heavily. The match was canceled.”
→ Cause-Effect relation.

4. Template-based Representation

Predefined sentence templates with placeholders for data.

Example:
"The temperature is {temp} degrees and the weather is {condition}."

5. Deep Learning Representations

Modern systems (like GPT, T5) use vector embeddings or hidden states as
representations.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

These encode context, grammar, and meaning in numerical form.

⚙️4. Example: Full Process

Input Data:

City: Chennai
Temperature: 35°C
Weather: Sunny

Process:

1. Content Determination: Select all three items.

2. Text Planning: Order → City → Weather → Temperature.

3. Sentence Planning: Aggregate → “Chennai will be sunny with a


temperature of 35°C.”

4. Surface Realization: Produce final text.

Output:

> “Chennai will be sunny with a temperature of 35°C.”

Applications of NLG

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🔹 1. Automated Report Generation

NLG can generate reports directly from data.

Common in weather forecasting, financial summaries, business analytics, and


sports reports.

Example: “Company revenue increased by 10% this quarter compared to last


year.”

🔹 2. Data-to-Text Summarization

Converts numerical or structured data into readable summaries.

Used in news generation, scientific reports, and medical records.

Example: “The patient’s blood pressure remained stable throughout the week.”

🔹 3. Chatbots and Virtual Assistants

NLG enables chatbots like Alexa, Siri, or Google Assistant to respond naturally.
Converts intent and data into conversational text.

Example:
User: “What’s the weather?”
Bot: “Today will be sunny with a high of 32°C.”

🔹 4. Personalized Content Creation

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Generates custom messages for marketing, education, or healthcare.

Example: Personalized emails, feedback reports, or learning content.

Example: “Hi Sridevi, here’s your weekly progress report. You improved your
vocabulary score by 20%!”

🔹 5. News and Media Generation

Automatically produces sports updates, election coverage, or financial news.

Used by agencies like Reuters or Associated Press to create quick articles.

Example: “Team India won by 5 wickets against Australia in today’s match.”

🔹 6. Dialogue and Story Generation

Creates natural, context-aware dialogues in games, movies, and storytelling


applications.

Example: AI-based storytelling platforms that generate narratives from prompts.

🔹 7. Question Answering and Explanation Systems

NLG helps generate human-like explanations for AI or decision-support systems.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example: “The system recommends this medicine because your symptoms match
mild allergy reactions.”

🔹 8. E-commerce and Product Descriptions

Automatically generates product summaries and reviews.

Example: “This smartphone features a 6.5-inch display and a long-lasting 5000


mAh battery.”

🔹 9. Educational Tools

NLG assists in automatic grading feedback, exam summary creation, and lesson
text generation.

Example: “You answered 8 out of 10 correctly. Review the chapter on


photosynthesis for better understanding.”

🔹 10. Healthcare and Medical Reporting

Generates patient summaries, diagnosis reports, and treatment explanations from


hospital data.

Example: “The patient’s temperature and blood pressure are within normal
range.”
Introduction

Machine Translation (MT) is a subfield of Natural Language Processing (NLP)

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

that focuses on automatically translating text or speech from one language to


another using computers.

Example:
English → “How are you?”
Tamil → “நீங்கள்எப்படிஇருக்கிறீர்கள்?”

Although MT systems (like Google Translate) have improved a lot, perfect


translation is still very challenging due to differences between human languages.

⚙️2. Problems in Machine Translation

Machine Translation faces several linguistic, semantic, and cultural challenges.


The main problems are explained below 👇

🔹 1. Lexical Ambiguity (Word Meaning Problem)

Many words have multiple meanings, depending on context.

The system may select the wrong meaning.

Example:

“Bank” → could mean river bank or financial bank.

“He went to the bank.” (Which one?)

👉 MT systems struggle to choose the right sense of a word without full context.

🔹 2. Structural or Syntactic Ambiguity

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Sentence structure can be interpreted in more than one way.

Example:
“I saw the man with the telescope.”
→ Did I have the telescope, or the man?
👉 Machine translation systems often fail to resolve such syntactic ambiguities.

🔹 3. Word Order Differences

Different languages follow different word order patterns.

English → Subject–Verb–Object (SVO): “I eat apples.”

Hindi/Tamil → Subject–Object–Verb (SOV): “I apples eat.”

👉 Translating word-by-word leads to unnatural or incorrect sentence structures.

🔹 4. Idioms and Expressions

Idioms cannot be translated literally.

Example:
“Kick the bucket” → (English idiom for “to die”)
Literal translation into another language would be meaningless.

👉 MT systems often fail to capture figurative or idiomatic meanings.

🔹 5. Cultural and Contextual Differences

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Words or phrases may have different meanings in different cultures.

Example:
“Tea time” in British culture refers to a meal, not just drinking tea.
👉 MT struggles with non-literal and culture-specific expressions.

🔹 6. Morphological Differences

Some languages are highly inflected (word endings change for tense, gender, or
number).

Example (English → Tamil):


“He goes” → “அவன்போகிறான்” (verb changes with gender/person).
👉 MT systems often make grammar errors in such cases.

🔹 7. Lack of One-to-One Word Correspondence

Many words in one language do not have direct equivalents in another.

Example:
The Tamil word “அழகு” can mean “beauty,” “beautiful,” or “handsome,”
depending on context.
👉 MT systems must infer meaning based on sentence context, which is difficult

🔹 8. Long-Distance Dependencies

Some words depend on others far apart in the sentence (common in complex
sentences).

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example:
“The book that you gave me yesterday was very interesting.”
→ “Book” and “was” must agree, though far apart.
👉 MT often loses grammatical agreement or sentence consistency.

🔹 9. Named Entity and Proper Noun Translation

Names, places, or organizations may need to be transliterated or left unchanged.

Example: “New Delhi” should remain as நியூடெல்லி, not translated literally.


👉 Errors in name translation can distort meaning.

🔹 10. Domain and Style Variation

MT systems trained on general text perform poorly on specialized fields (medical,


legal, technical).

Example: “Mouse” in computer science ≠ “mouse” (animal).


👉 Domain-specific translation needs special training data.

1. Characteristics of Indian Languages

Indian languages have rich linguistic features that make machine translation (MT)
challenging and interesting.

🔹 1. Morphologically Rich

Indian languages (like Tamil, Hindi, Telugu) are highly inflected — a single root

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

word can have many forms based on tense, gender, and number.
Example (Tamil):

போ (root “go”) → போகிறான், போகிறாள், போகிறேன்


(He goes, She goes, I go)

🔹 2. Free Word Order

Most Indian languages follow Subject–Object–Verb (SOV) order, but the order
can vary for emphasis.
Example (Hindi):
“रामआमखाताहै ” = “Ram mango eats”
→ can also appear as “आमरामखाताहै ” (same meaning).
English is SVO, which makes translation harder.

🔹 3. Rich Agreement System

Verbs agree with subject gender, number, and person.


Example (Hindi):

वहजाताहै (He goes)

वहजातीहै (She goes)

🔹 4. Postpositions (Not Prepositions)

Indian languages usually use postpositions after the noun, unlike English
prepositions.
Example:
English: “on the table” → Hindi: “मे ज़पर” (table on)

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🔹 5. Complex Compounds and Derivations

Many Indian languages form compound words by combining several roots.


Example (Tamil): “வீட்டுத்தோட்டம்” (House + Garden)

🔹 6. Script and Orthography Diversity

Multiple scripts (Devanagari, Tamil, Telugu, Kannada, Bengali, etc.).


Some share vocabulary but differ in script and pronunciation.

🔹 7. Common Root (Sanskrit Influence)

Many Indian languages share vocabulary and grammar from Sanskrit, making
inter-Indian translation somewhat easier than English–Indian translation.

Machine Translation Approaches:

Machine translation systems use different approaches to convert text from one
language to another.

🔸 1. Rule-Based Machine Translation (RBMT)

Based on linguistic rules and dictionaries.

Requires morphological, syntactic, and semantic analysis.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Works well for Indian languages with proper grammar rules.

Types:

Direct Translation: Word-by-word (used for related languages).

Transfer-Based: Uses intermediate structure transfer.

Interlingua-Based: Converts both languages into a common intermediate form.

Example:
English → Interlingua → Hindi

Advantages:
Grammatically accurate for simple sentences.
Disadvantages:
Needs extensive linguistic knowledge and rules for each pair of languages.

🔸 2. Statistical Machine Translation (SMT)

Based on probabilities learned from large bilingual corpora.

Uses parallel texts to learn which words correspond between languages.

Example: Google Translate (earlier version).


Advantages: Learns automatically from data.
Disadvantages: Requires large datasets; struggles with rich morphology.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🔸 3. Example-Based Machine Translation (EBMT)

Uses previous examples of translated sentences.

For new sentences, the system finds the closest match and adapts it.
Advantage: Works well when similar sentences exist in database.
Disadvantage: Fails for unseen sentence structures.

🔸 4. Neural Machine Translation (NMT)

Uses deep learning (neural networks) to model translation as a sequence-to-


sequence problem.

Learns context, grammar, and meaning automatically.


Example: Google Translate (modern version using Transformer models).

Advantages:

Produces fluent, natural translations.

Learns long-range dependencies.

Disadvantages:

Requires massive parallel data.

Sometimes generates grammatically correct but semantically wrong sentences.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🔸 5. Hybrid Machine Translation

Combines Rule-Based + Statistical/Neural methods.

Commonly used for Indian languages to handle both linguistic rules and data-
driven learning.

Translation Involving Indian Languages

Because of unique Indian language characteristics, special strategies are used in


MT systems.

1. English ↔ Indian Language Translation

Difficult due to differences in word order, morphology, and syntax.

Requires reordering modules and morphological analyzers.

Examples:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

AnglaMT – English ↔ Indian languages (Hindi, Tamil, etc.)

Anusaaraka – English → Hindi and other Indian languages

ILMT (Indian Language Machine Translation Project) – Multilingual MT by


Government of India

2. Indian ↔ Indian Language Translation

Easier compared to English translation because of shared grammar and


vocabulary roots.
Example systems:
Sampark Project – Pan-Indian language translation system (developed by IITs,
IIITs, and CDAC).

Anusaaraka – Hindi ↔ Telugu, Bengali, Marathi, etc.

3. Key Challenges

Lack of large parallel corpora for Indian languages.

Ambiguity and free word order.

Script differences across states.

Need for morphological analyzers and POS taggers for each language.

4. Ongoing Indian MT Initiatives

Project Description

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Anusaaraka :Translates Indian languages using language-access approach.


AnglaMT :English-to-Indian translation (Rule-based).
Sampark :Multilingual MT system (uses transfer-based approach).
ILMT (TDIL Project): Covers multiple Indian language pairs.

1. The full form of NLG is:


A) Natural Logic Generation
B) Natural Language Generation
C) Natural Linguistic Grammar
D) Neural Language Grammar
Answer: B

2. The main goal of Natural Language Generation (NLG) is to:


A) Understand natural language
B) Produce human-like text from structured data
C) Translate between languages
D) Parse sentences syntactically
Answer: B

3. NLG is considered the reverse process of:


A) Machine Translation
B) Natural Language Understanding (NLU)
C) Speech Recognition
D) Tokenization
Answer: B

4. The first step in a typical NLG architecture is:


A) Surface realization
B) Document planning
C) Sentence aggregation
D) Linguistic realization
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

5. The last step in an NLG system is:


A) Content selection
B) Surface realization
C) Sentence planning
D) Lexicalization
Answer: B

6. Content determination in NLG involves:


A) Deciding what information to include in the output
B) Deciding grammar rules
C) Translating text
D) Tagging parts of speech
Answer: A

7. Microplanning in NLG refers to:


A) Sentence-level planning including lexical choice and referring expressions
B) Deciding the topic of the text
C) Translating sentences
D) Parsing input text
Answer: A

8. The Surface Realization module in NLG handles:


A) Grammar, morphology, and word order
B) Word meaning
C) Sentence understanding
D) Syntax parsing
Answer: A

9. NLG is used in:


A) Speech synthesis
B) Automatic report generation
C) Dialogue systems
D) All of the above
Answer: D

10. A template-based NLG system:


A) Uses deep learning models
B) Uses pre-defined sentence structures to fill in data
C) Generates completely new sentences
D) Performs machine translation
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

11. Which of the following is an application of NLG?


A) Weather forecasting reports
B) Chatbots
C) Automated news summaries
D) All of the above
Answer: D

12. Machine Translation (MT) refers to:


A) Translation of speech to text
B) Automatic translation of text from one language to another
C) Parsing of text into syntax
D) Transliteration
Answer: B

13. The earliest MT systems were based on:


A) Statistical models
B) Rule-based approaches
C) Neural networks
D) Hybrid methods
Answer: B

14. A major problem in Machine Translation is:


A) Lexical ambiguity
B) Structural ambiguity
C) Cultural and idiomatic differences
D) All of the above
Answer: D

15. The rule-based approach to MT depends on:


A) Deep neural networks
B) Hand-crafted linguistic rules and bilingual dictionaries
C) Statistical probabilities
D) Context embeddings
Answer: B

16. The statistical approach to MT (SMT) relies on:


A) Parallel corpora and probability models
B) Grammar rules
C) Lexical databases
D) Template matching
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

17. The neural approach to MT (NMT) uses:


A) Neural networks to model translation probability
B) Hand-written grammar rules
C) Symbolic reasoning
D) POS tagging only
Answer: A

18. In Neural Machine Translation, the encoder-decoder model is typically based on:
A) Decision trees
B) Recurrent Neural Networks (RNNs) or Transformers
C) Hidden Markov Models
D) Context-Free Grammars
Answer: B

19. One key advantage of Neural Machine Translation over Statistical MT is:
A) Handles long-range dependencies better
B) Requires no data
C) Works only for English
D) Is rule-based
Answer: A

20. Back-translation in NMT helps by:


A) Improving training data using synthetic parallel sentences
B) Translating from speech to text
C) Detecting grammar errors
D) Evaluating model accuracy
Answer: A

21. A major challenge in translating Indian languages is:


A) Rich morphology and agglutination
B) Free word order
C) Lack of large parallel corpora
D) All of the above
Answer: D

22. Indian languages are largely:


A) Analytic
B) Agglutinative and morphologically rich
C) Logographic
D) Monolingual
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

23. In India, early MT projects like ANGLABHARATI and MANTRA were based on:
A) Statistical models
B) Rule-based systems
C) Neural networks
D) Lexical semantics
Answer: B

24. A hybrid approach to MT combines:


A) Statistical and rule-based methods
B) Neural and symbolic models
C) Both A and B
D) Only neural networks
Answer: C

25. The goal of translation involving Indian languages is to:


A) Maintain word-by-word mapping
B) Preserve meaning, structure, and cultural context
C) Simplify sentence syntax
D) Focus only on syntax
Answer: B

🌿 Section B: 5-Mark Questions (Answer any 5 × 5 = 25 Marks)

1. Explain the architecture of a Natural Language Generation (NLG) system with a


neat diagram.
2. What are the main tasks and representations used in NLG?
3. Discuss any three major applications of NLG in modern systems.
4. Identify the main problems in Machine Translation (MT) with examples.
5. Write short notes on the characteristics of Indian languages that affect MT.
6. Differentiate between rule-based and statistical approaches to Machine Translation.

🌿 Section C: 10-Mark Questions (Answer any 6 × 10 = 60 Marks)

1. Describe in detail the architecture of NLG systems, explaining the roles of document
planning, microplanning, and surface realization.
2. Explain the various generation tasks and representations involved in the NLG
pipeline with suitable examples.
3. Discuss the applications of NLG in fields such as summarization, dialogue systems,
and automated reporting.
4. What are the problems in Machine Translation? Explain with examples of ambiguity,
syntax, and cultural differences.
5. Compare and contrast rule-based, statistical, and neural approaches to Machine
Translation, highlighting their advantages and limitations.
6. Explain the challenges of Machine Translation for Indian languages and discuss
approaches like ANGLABHARATI, MANTRA, and Sampark systems.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Unit 5
Informationretrievalandlexical resources
Information Retrieval: Design features of Information Retrieval Systems-
Classical, Non-classical, Alternative Models of Information Retrieval –
valuation Lexical Resources: WorldNet Frame Net Stemmers- POS
Tagger- Research Corpora SSAS.

Information Retrieval (IR) in NLP

Definition: Information Retrieval (IR) is the process of finding relevant


information or documents from large collections (like the web, databases, or
digital libraries) based on a user query.
In Natural Language Processing (NLP), IR focuses on understanding and
processing human language queries and documents to improve search accuracy
and relevance.

Key Components of an IR System

1. Document Collection:
A database or corpus containing all documents or text data.

2. Indexing:
Converting the collection into a structure (like an inverted index) for fast
searching.

Example: Word → List of documents containing that word.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

3. Query Processing:
Analyzing and transforming the user’s input query into a machine-readable form.

Example: Removing stop words, stemming, or lemmatization.

4. Retrieval Model:
A mathematical model that ranks documents based on their relevance to the
query.

Common models include:

Boolean Model

Vector Space Model

Probabilistic Model (BM25)

Neural IR models (using deep learning)

5. Ranking & Scoring:


Each document gets a score indicating how relevant it is to the query.

6. Evaluation:
Checking how effective the retrieval is, using metrics such as:

Precision

Recall

F1-score

Mean Average Precision (MAP)

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Design Features of Information Retrieval (IR) Systems

Information Retrieval (IR) systems are designed to help users find relevant
information from large collections of text or documents efficiently and accurately.
The design features define how the system stores, processes, retrieves, and ranks
information.

1. Document Representation

Each document in the collection is represented in a structured form for easy


comparison and retrieval.

Common methods:

Bag of Words (BoW) model

Vector Space Model

Embedding-based representation (using Word2Vec, BERT, etc.)

Includes preprocessing steps like tokenization, stemming, stop-word removal, etc.

2. Indexing

Purpose: To speed up search and retrieval.

The system builds an inverted index mapping each term to the list of documents
containing it.

Features:

Term frequency counts

Document identifiers

Efficient storage structures (e.g., hash tables, B-trees)

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

3. Query Processing

The user’s input query is analyzed and transformed into a format that matches the
document representation.

Includes:

Tokenization, stemming, lemmatization

Stop-word removal

Query expansion (adding synonyms or related terms)

Spell correction and auto-suggestion

4. Matching and Ranking Mechanism

The core of the IR system — compares the user’s query with stored documents.

Ranking algorithms assign scores based on similarity or relevance.

Examples: TF-IDF, BM25, Cosine similarity, Neural ranking models

Ensures the most relevant results appear first.

5. User Interface (UI)

Provides an easy and interactive way for users to enter queries and view results.

Features:

Search box

Ranked results display

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Filters and advanced search options

Snippets or summaries showing query-relevant parts of documents

6. Feedback and Relevance Feedback

Users can provide feedback on the relevance of retrieved results.

The system uses this to improve future searches.

Example: Rocchio algorithm adjusts the query based on user feedback.

7. Evaluation and Performance Measurement

Evaluates how well the system retrieves relevant documents.

Common metrics:

Precision

Recall

F1-score

Mean Average Precision (MAP)

Also measures system performance (speed, scalability, memory use).

8. Scalability and Efficiency

The system should handle large datasets efficiently.

Uses:

Distributed databases

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Parallel indexing and retrieval

Caching frequently used queries

9. Security and Access Control

Ensures only authorized users can access specific data.

Features:

Authentication and encryption

Access rights management

10. Multilingual and Semantic Capabilities

Modern IR systems support multiple languages and understand meaning, not just
keywords.

Semantic search using embeddings

Cross-lingual retrieval for multilingual users

1. Classical Models of Information Retrieval

These are the traditional models used in IR.


They are based on mathematical and statistical approaches for ranking and
retrieving documents.

(a) Boolean Model

Based on set theory and Boolean logic (AND, OR, NOT).

A document is retrieved or not retrieved — no ranking.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example:
Query: “machine AND learning” → retrieves documents
containing both terms.

Advantages:

Simple and easy to implement.

Limitations:

No ranking or partial matching.

Hard for users to form precise Boolean queries.

(b) Vector Space Model (VSM)

Represents documents and queries as vectors in a multi-dimensional space.

Each term is assigned a weight (e.g., using TF-IDF).

Similarity between a document and a query is measured using Cosine Similarity.

Advantages:

Provides ranking of documents.

Supports partial matching.

Limitations:

Assumes terms are independent.

Does not capture semantic relationships.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

(c) Probabilistic Model

Based on probability theory — ranks documents according to the likelihood that


they are relevant to a query.

Example: BM25 (Okapi) model.

Advantages:

Statistically sound and performs well in practice.

Limitations:

Requires training data or relevance feedback to estimate probabilities.

✅ Summary of Classical Models:

Model Basis Ranking Key Idea

Boolean Logic No Exact match


Vector Space Algebra Yes Cosine similarity
ProbabilisticProbability Yes Likelihood of relevance

⚙️ 2. Non-Classical Models of Information Retrieval

These models go beyond classical logic and probability, using alternative


mathematical theories like fuzzy sets or information theory.

(a) Fuzzy Set Model

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Handles vague or imprecise queries using fuzzy logic.

Terms have degrees of membership rather than binary (0 or 1).

Advantage: Deals better with uncertainty and partial relevance.

Example:
A document can be 0.7 relevant instead of strictly relevant or not.

(b) Extended Boolean Model

Combines Boolean and Vector models.

Allows partial matching and ranking while keeping Boolean query structure.

Uses p-norms to calculate similarity.

(c) Inference Network Model

Based on Bayesian networks and probabilistic inference.

Represents relationships among queries, terms, and documents as a network.

Used in modern IR systems like Indri and Lemur.

✅ Summary of Non-Classical Models:

Model Concept Feature

Fuzzy Set Fuzzy logic Handles uncertainty


Extended Boolean Boolean + vector Partial matching
Inference Network Bayesian networks Probabilistic inference

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

🤖 3. Alternative (Modern or Neural) Models of Information Retrieval

These are advanced models that use machine learning and deep learning to
improve retrieval performance.

(a) Latent Semantic Indexing (LSI)

Uses Singular Value Decomposition (SVD) to capture latent (hidden)


relationships between terms and documents.

Reduces dimensionality and finds semantic similarity.

Advantage: Handles synonymy (different words, same meaning).

(b) Language Models for IR

Treat retrieval as a generative process — each document is a language model.

The system ranks documents by how likely they are to generate the query.

Example: Query Likelihood Model.

(c) Neural and Deep Learning Models

Use word embeddings (Word2Vec, GloVe) or transformers (BERT, GPT) to


understand semantic meaning.

Employ neural ranking to match queries and documents.

Advantages:

Captures context and meaning.

Supports natural language queries.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

WordNet

Definition:

WordNet is a large lexical database of English developed at Princeton University.

It groups English words into synsets (sets of synonyms) and describes their
semantic relationships.

Key Features:

Each synset represents a concept.

Relations include:

Synonymy – same meaning (e.g., car = automobile)

Antonymy – opposite meaning (e.g., hot ≠ cold)

Hyponymy/Hypernymy – “is-a” relationship (e.g., rose is a flower)

Meronymy – part-whole relationship (e.g., wheel is part of car)

Applications:

Word sense disambiguation

Semantic search and information retrieval

Text classification

Machine translation

FrameNet

Definition:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

FrameNet is a lexical database based on frame semantics, developed at UC


Berkeley.

A frame describes a conceptual structure representing a type of event, relation, or


object and its participants (called frame elements).

Example:

Frame: Buying

Core elements: Buyer, Seller, Goods, Money

Sentence: “John bought a book from Mary for ₹200.”

Buyer: John

Seller: Mary

Goods: book

Money: ₹200

Applications:

Semantic role labeling

Information extraction

Question answering

Understanding sentence meaning in context

Stemmers

Definition:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

A stemmer is an algorithm that reduces words to their base or root form (called a
“stem”).

Used in indexing, search, and text normalization.

Example:

“running”, “runs”, “ran” → “run”

Common Algorithms:

Porter Stemmer

Snowball Stemmer

Lancaster Stemmer

Applications:

Search engines

Text classification

Sentiment analysis

POS Tagger (Part-of-Speech Tagger)

Definition:

A POS Tagger assigns each word in a sentence a part of speech, such as noun,
verb, adjective, etc.

Helps understand syntactic structure and grammatical meaning.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Example:

> Sentence: The quick brown fox jumps over the lazy dog

Tags:
The/DT quick/JJ brown/JJ fox/NN jumps/VBZ over/IN the/DT lazy/JJ dog/NN

Techniques Used:

Rule-based taggers

Statistical taggers (e.g., Hidden Markov Models)

Neural taggers (using BERT, LSTM, etc.)

Applications:

Machine translation

Information extraction

Named Entity Recognition (NER)

Question answering

Research Corpora

Definition:

A corpus (plural: corpora) is a large, structured collection of texts used for


linguistic and NLP research.

Corpora are annotated with linguistic information such as POS tags, parse trees,

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

or semantic roles.

Examples:

Brown Corpus – first major English text corpus.

British National Corpus (BNC) – general-purpose English corpus.

Penn Treebank – annotated with syntactic structures.

Google N-Gram Corpus – large-scale web text dataset.

Uses:

Training and testing NLP models

Studying language patterns and frequency

Building lexicons and statistical models

SSAS (Statistical and Semantic Analysis Systems)

Definition:

SSAS refers to systems or approaches that combine statistical and semantic


methods for analyzing language.

They are used to extract meaning, find relationships, and improve retrieval
accuracy.

Components:

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

Statistical Analysis: Uses word frequencies, co-occurrence, and probabilistic


models.

Semantic Analysis: Uses meaning-based tools like WordNet, FrameNet,


embeddings (Word2Vec, BERT).

Applications:

Text mining and information retrieval

Document clustering and classification

Semantic search engines

Chatbots and question answering

1. The goal of an Information Retrieval (IR) system is to:


A) Store data efficiently
B) Retrieve relevant information based on a user query
C) Parse natural language sentences
D) Perform sentiment analysis
Answer: B

2. A typical IR system retrieves:


A) Exact matches only
B) Documents relevant to the user’s query
C) Only images and videos
D) Database tables
Answer: B

3. One of the main design features of an IR system is:


A) User interface
B) Indexing mechanism
C) Query processing
D) All of the above
Answer: D

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

4. The core components of an IR system are:


A) Indexing, Searching, Ranking
B) Parsing, Translation, Classification
C) Tokenization, Parsing, Speech generation
D) Matching, Learning, Translating
Answer: A

5. The classical model of IR is based on:


A) Neural networks
B) Boolean and vector space models
C) Deep learning
D) Genetic algorithms
Answer: B

6. In the Boolean model, documents are retrieved using:


A) Probabilities
B) Logical operators (AND, OR, NOT)
C) Semantic roles
D) Neural embeddings
Answer: B

7. The Vector Space Model (VSM) represents documents as:


A) Strings of characters
B) Graphs
C) Vectors in multi-dimensional space
D) Parse trees
Answer: C

8. The TF-IDF weighting scheme stands for:


A) Term Frequency – Inverse Document Frequency
B) Text Format – Information Data Function
C) Term Function – Information Dimension
D) Term Frequency – Indexed Document Form
Answer: A

9. Non-classical IR models are primarily based on:


A) Probabilistic and fuzzy logic approaches
B) Boolean retrieval
C) Keyword indexing
D) Character matching
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

10. The Probabilistic IR model ranks documents based on:


A) Word order
B) The probability of relevance to a query
C) Sentence grammar
D) Lexical frequency only
Answer: B

11. Alternative IR models include:


A) Neural and semantic-based retrieval models
B) Boolean and vector models only
C) Only keyword matching models
D) Phonetic-based models
Answer: A

12. Evaluation of IR systems is usually performed using:


A) Recall and Precision
B) Accuracy only
C) BLEU score
D) Fuzzy entropy
Answer: A

13. Recall measures:


A) The proportion of retrieved documents that are relevant
B) The proportion of relevant documents that are retrieved
C) Document length
D) User satisfaction
Answer: B

14. Precision measures:


A) Total documents retrieved
B) The proportion of retrieved documents that are relevant
C) The number of queries processed
D) Indexing efficiency
Answer: B

15. WordNet is a:
A) Speech recognition tool
B) Lexical database for English
C) Machine translation engine
D) Statistical corpus
Answer: B

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

16. In WordNet, synsets represent:


A) Sets of synonyms expressing a single concept
B) Morphological rules
C) Sentiment scores
D) Grammar rules
Answer: A

17. FrameNet is a resource based on:


A) Syntax trees
B) Semantic frames and roles
C) Morphological parsing
D) Vector representations
Answer: B

18. The purpose of a stemmer is to:


A) Identify parts of speech
B) Reduce words to their root or base form
C) Translate text
D) Extract named entities
Answer: B

19. The Porter stemmer is:


A) A rule-based morphological analyzer
B) A probabilistic tagger
C) A deep learning model
D) A dependency parser
Answer: A

20. A POS tagger assigns:


A) Sentence boundaries
B) Word categories like noun, verb, adjective
C) Pronunciation
D) Meaning of sentences
Answer: B

21. POS tagging helps in:


A) Understanding word functions in a sentence
B) Translating text
C) Stemming words
D) Phonetic transcription
Answer: A

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

22. Research corpora are used for:


A) Manual translation
B) Training and evaluating NLP models
C) Word stemming only
D) Text encryption
Answer: B

23. The acronym SSAS often refers to:


A) Sentence Structure and Analysis System
B) Speech Synthesis and Analysis System
C) Semantic Search and Annotation System
D) Syntax Storage and Access System
Answer: B

24. A corpus in NLP refers to:


A) A body of structured text used for linguistic analysis
B) A single document
C) A grammar rule set
D) A data encryption method
Answer: A

25. Lexical resources like WordNet and FrameNet are primarily used for:
A) Machine translation only
B) Word meaning representation and semantic relations
C) Speech synthesis
D) Syntax parsing
Answer: B

✅ Answer Key Summary


1-B | 2-B | 3-D | 4-A | 5-B | 6-B | 7-C | 8-A | 9-A | 10-B |
11-A | 12-A | 13-B | 14-B | 15-B | 16-A | 17-B | 18-B | 19-A | 20-B |
21-A | 22-B | 23-B | 24-A | 25-B

🌿 Section B: 5-Mark Questions (Answer any 5 × 5 = 25 Marks)

1. Explain the design features of an Information Retrieval (IR) system.


2. What are the classical models of Information Retrieval? Describe them briefly.
3. Define precision and recall. How are they used to evaluate IR systems?
4. What is WordNet? Explain its structure and uses in NLP.
5. What is a stemmer? Explain its role in Information Retrieval.
6. Describe the function of a POS tagger in lexical analysis.

🌿 Section C: 10-Mark Questions (Answer any 6 × 10 = 60 Marks)


AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])


lOMoARcPSD|62849738

1. Describe the architecture and working of a typical Information Retrieval system.


2. Compare classical, non-classical, and alternative models of IR with examples.
3. Explain how precision, recall, and F-measure are used for the evaluation of IR
systems.
4. Discuss WordNet and FrameNet as lexical resources. Explain their structure and
importance in NLP.
5. Explain the roles of stemmers, POS taggers, and research corpora in information
retrieval and language processing.
6. What is SSAS (Speech Synthesis and Analysis System)? Describe its components and
applications.

AVSCASLEARNINGRESOURCE

Downloaded by GTMC BCA (gtmcbca@[Link])

You might also like