Q1) What is rule base machine translation?
[5M] x2
Q4) Explain Machine Translation Approaches used in NLP. [5M]
Q6) Explain statistical approach for machine translation. [5M]
Q9) Demonstrate the working of machine translation systems. [10M]
Q3) Explain Text summarization in detail. [10M] x2
Text summarization is the process of distilling the most important information from a source text into
a shorter version while preserving its core meaning, intent, and key details. It's not just "shortening"
– it's intelligent compression that requires understanding semantics, salience, and context. Humans
do it intuitively when they recap a movie; machines need algorithms, linguistics, and stats to
approximate it.
Below is the full theoretical breakdown, no fluff, no emojis, no "in today's world" intros. Just dense
text, bullet hierarchies, and one concrete example at the end.
1. Core Objectives of Summarization
• Information Retention: Keep facts, arguments, conclusions.
• Brevity: Reduce length by 50–90% without losing essence.
• Coherence: Output must read naturally, not like chopped sentences.
• Non-Redundancy: Eliminate repetition (e.g., same idea in intro and conclusion).
• Salience Preservation: Prioritize central claims over examples or tangents.
• Faithfulness: No hallucination – summarized content must be inferable from source.
2. Types of Summarization
Type Definition Output Style Use Case
Extractive Selects and concatenates existing Direct quotes or News headlines, legal
sentences/phrases from the text. near-verbatim doc highlights, search
spans. snippets.
Abstractive Paraphrases, generalizes, and Natural, rephrased, Research paper
synthesizes new sentences. often shorter. abstracts, chatbots,
storytelling.
Hybrid Mix of extractive (for facts) + Balanced Long reports, meeting
abstractive (for flow). readability + minutes.
fidelity.
3. Extractive Summarization – How It Works
Step-by-Step Mechanism:
1. Sentence Segmentation: Split text via punctuation/NLP parsers.
2. Feature Extraction: TF-IDF (word importance), sentence position (first/last = key), cue
phrases ("in conclusion"), medium length, uppercase/title words, cosine similarity to
document centroid.
3. Scoring & Ranking: Weighted sum of features → salience score.
4. Selection: Greedy (top-N) or MMR (high-score + dissimilarity to avoid redundancy).
5. Ordering: Original sequence for narrative flow.
Classic Algorithms:
• TextRank/LexRank: PageRank on sentence graph (cosine edges; LexRank uses stochastic
matrix).
• Luhn (1958): Cluster high-frequency non-stopwords, pick dense-cluster sentences.
• Edmundson: Cue + Title + Location + Length weights.
Limitation: Choppy, incoherent output; no inference.
4. Abstractive Summarization – How It Works
Core Challenges: Semantic parsing (coreference/entailment), fluent generation (grammar/style),
grounded output (no hallucination).
Pre-Transformer Pipeline:
1. Content selection (key entities/relations).
2. Sentence planning (order/content).
3. Surface realization (grammatical sentences).
Neural (Seq2Seq Era):
• Encoder-Decoder: RNN/LSTM encodes → decoder generates with attention (Bahdanau,
2014).
• Copy Mechanism: Pointer-Generator copies rare tokens.
• Coverage Loss: Penalizes repetitive attention.
Transformer-Based (Post-2018):
• BART: Denoising pretraining (mask/shuffle/infill).
• T5: Text-to-text ("summarize: [text]").
• PEGASUS: Mask/regenerate key sentences.
• LLMs (GPT/LLaMA/Grok): Zero/few-shot via prompts.
Prompt Example: Summarize in 3 sentences: [article]
5. Evaluation Metrics
Metric Type What It Measures Formula Limitation
ROUGE N-gram overlap Word/phrase match ROUGE-N = (∑ Ignores semantics
between summary matching n-grams)
and reference / (total in ref)
BLEU Precision on n- Used in MT, Similar to ROUGE Punishes valid
grams sometimes in but penalizes paraphrases
summarization length
METEOR Stem, synonym, Better than BLEU for Weighted F-score Still surface-level
paraphrase meaning with synonyms
match
BERTScore Contextual Cosine similarity in F1 on token Computationally
embeddings BERT space embeddings heavy
6. Challenges in Summarization
• Coreference Resolution: "Obama" → "The President" → must track.
• Compression vs. Loss: Too short → omit nuance; too long → not summary.
• Domain Dependence: Scientific text ≠ news ≠ fiction.
• Bias Amplification: Model may over-represent majority view.
• Evaluation Gap: High ROUGE ≠ human quality.
• Long Documents: Attention dilution, memory limits (solved partially by Longformer, BigBird).
• Multilingual: Low-resource languages lack data/models.
7. Example
Source text: A cat named Mizu stole a fish from the market. The shopkeeper chased Mizu across the
street. Mizu escaped and ate the fish on a rooftop.
Extractive Summary (1 line): A cat named Mizu stole a fish from the market. Mizu escaped and ate
the fish on a rooftop.
Abstractive Summary (1 line): Mizu the cat stole and ate a fish after escaping the shopkeeper.
Q2) Explain the different steps in text processing for Information Retrieval.
[5M]
Q10) Explain the Information retrieval system. [10M]
Information Retrieval (IR) is the science of searching large collections of unstructured/semi-
structured data (e.g., documents, web pages) to return relevant items matching a user's information
need; it's not exact matching like databases but probabilistic relevance ranking; core goal: bridge gap
between user query and vast data via efficient indexing and scoring; invented in 1950s for libraries,
evolved to search engines like Google.
Below: Dense theory in simple terms, diagram breakdown with data flows (numbered as per
diagram), bullets for hierarchy, multi-point lines where concise; ends with toy example. Exam tip:
Start with definition + diagram overview, then flows, then example (total ~1 page handwritten).
1. Core Objectives of IR
• Relevance: Return docs most useful to query (not all matches).
• Efficiency: Handle massive scales (millions of docs) in seconds via pre-computed indexes.
• Effectiveness: High precision (few irrelevant results) + recall (few misses) trade-off.
• User-Centric: Support natural queries, feedback loops for refinement.
• Scalability: Offline indexing + real-time retrieval.
2. High-Level Architecture (Classic Vector Space Model)
IR splits into offline (indexing) and online (retrieval) phases; uses inverted indexes (word → doc list)
for fast lookup; models like Boolean (AND/OR/NOT), Vector (cosine similarity), Probabilistic (Okapi
BM25).
Phase Purpose Key Steps Tools/Techniques
Indexing Pre-process collection Tokenize, stem, stopword Lucene,
(Offline) for quick access. removal, build inverted index. Elasticsearch.
Retrieval Match query to index, Parse query, search, score, TF-IDF, PageRank.
(Online) rank results. present.
3. Diagram Breakdown: Components & Data Flows
Diagram shows modular IR pipeline with user loop; left: user input/feedback; center: processing;
right: storage/output; numbers trace flows (e.g., 1= user need to interface).
Main Components (Simple Terms):
• User Interface :Front-end for query input/output; handles natural language, spell-check,
facets (e.g., date filters); flow: ranked docs back to user.
• Text Operations: Pre-processes raw text; tokenizes (splits words), normalizes (lowercase,
stemming like "running"→"run"), removes noise (stopwords like "the"); outputs logical view
(structured rep).
• Query Operations: Refines user query; expands synonyms (e.g., "car"→"auto"), handles
operators (AND/OR); user feedback loop refines (e.g., "too broad? add filters").
• Searching: Matches query terms to index; uses inverted file for fast lookup (term → doc IDs);
retrieves candidate docs.
• Ranking: Scores retrieved docs by relevance; factors: term freq (TF), rarity (IDF), proximity;
outputs ordered list.
• Indexing: Builds inverted index from logical view; maps terms to {docID, positions, freq}; flow
7: from text ops to index.
• DB Manager Module: Manages storage/retrieval; fetches full docs from Text DB using index
pointers.
• Text Database: Raw doc storage (e.g., files, DB); holds full content post-indexing.
• User Feedback: Loop from output back to query ops (e.g., "re-rank by date"); improves
relevance iteratively.
Data Flows (Step-by-Step, Numbered as Diagram):
1. User Need Input: Starts at left; user's info need (query like "best laptops") → User Interface
(simple form/search bar).
2. Query Path (Online Retrieval): User Interface → Query Operations (parse/expand) →
Searching (hit index for matches) → Retrieved Docs (raw hits) → Ranking (score/order) →
Ranked Docs → User Interface (display results) → User (view + feedback).
3. Indexing Path (Offline Build): Text from DB → Text Operations (preprocess to logical view) →
Indexing (create inverted file) → Index (stored structure) → DB Manager (link to full texts in
Text DB).
4. Feedback Loop: User → User Interface → Query Operations (refine based on "show more
like this") or back to Searching/Ranking.
5. Full Cycle: New docs added? Loop back via Text Operations → Indexing; query always uses
existing Index + DB.
Key Insight: Indexing is batch (slow, one-time); retrieval is interactive (fast); diagram emphasizes
modularity – swap rankers without rebuilding index.
4. Detailed Theory: Indexing & Retrieval Mechanics
Indexing (Inverted Index Build):
• Steps: Scan docs → extract terms → sort unique terms → for each term, list <docID, term
freq, positions>; compress with delta encoding.
• Example Structure: Term "cat": [Doc1: freq=2 pos=5,12; Doc3: freq=1 pos=8]; total size <<
full text.
• Benefits: O(1) term lookup vs. O(n) scan; supports phrases (pos check).
Retrieval (Query Processing):
• Query Parse: Boolean (cat AND dog), ranked (vector: query vec · doc vec / norms).
• Matching: Intersect posting lists (e.g., AND=common docs); union for OR.
• Scoring (TF-IDF): Score = Σ (TF_doc(term) * log(N/DF_term)) * query weight; TF=term count
in doc, DF=docs with term, N=total docs.
• Advanced: BM25 (normalizes doc len), Learning to Rank (ML on features like click data).
Challenges:
• Vocabulary Mismatch: Synonyms, misspellings → query expansion via thesaurus/LLMs.
• Scalability: Sharding indexes across servers; distributed like Solr.
• Evaluation: Precision@K (top K relevant?), Recall (all relevant found?), NDCG (ranked
quality).
5. Toy Dummy Example (Exam-Short: 5 Lines)
Collection (Text DB, 3 Docs – Dummy Book Snippets): Doc1: "The quick brown fox jumps over the
lazy dog." Doc2: "A cat chases a mouse in the garden." Doc3: "Fox and dog play fetch in park."
Offline Indexing:
• Text Ops preprocess (stem: jump→jump, remove "the");
• build index: "fox"→[Doc1:1, Doc3:1]; "dog"→[Doc1:1, Doc3:1]; "cat"→[Doc2:1].
Online Retrieval:
• User Query (via Interface): "fox dog" (Query Ops: AND).
• Searching: Intersect "fox" & "dog" lists → Retrieved Docs: Doc1, Doc3.
• Ranking: TF-IDF scores Doc1 higher (both terms present) > Doc3.
• Output (Ranked): Doc1 first, Doc3 second
• User Feedback: "More animals?" → Refine to include "cat".
Why Relevant? Doc1 matches query fully; shows flow: query→search→rank→feedback; easy to
sketch in exam.
Q5) Explain information retrieval versus Information extraction systems. [10M]
1. Definitions (1 Mark Each)
• Information Retrieval (IR): Process of searching and ranking a large collection of
unstructured/semi-structured documents to return relevant full documents matching a
user’s query; output = ordered list of docs; probabilistic, relevance-based.
• Information Extraction (IE): Process of automatically pulling structured data (entities,
relations, facts) from unstructured text; output = structured records (e.g., tables, triples);
precise, slot-filling, no ranking.
2. Core Differences – Exam Table (5 Marks)
Aspect Information Retrieval (IR) Information Extraction (IE)
Goal Find relevant documents Extract specific facts/relations
Input Query (keywords/phrase) + Unstructured text (doc/news/email)
document collection
Output Ranked list of full documents Structured data: {Name, Date, Location},
(Person, worksAt, Company)
Granularity Document-level Sentence/phrase-level
Precision vs High recall (don’t miss), rank best High precision (correct facts), low recall OK
Recall
Technique Inverted index, TF-IDF, BM25, NER, relation extraction, pattern matching,
vector similarity BERT-CRF
User Query → browse results → refine Auto-fill DB/template → no user loop
Interaction
Example Task “Find papers on NLP” → returns “Who founded Google?” → {Larry Page,
100 PDFs Sergey Brin}
Evaluation Precision@K, Recall, NDCG, MAP F1-score on entity/relation slots
System Type Search engine (Google, Pipeline (Stanford NLP, spaCy, OpenIE)
Elasticsearch)
IR Flow (Online + Offline)
[Offline]
Text DB → Text Ops (tokenize, stem) → Indexing → Inverted Index
[Online]
User Query → Query Ops → Searching (index lookup) → Ranking (TF-IDF) → Ranked Docs → User
IE Flow (One-Way Pipeline)
Text → Sentence Split → NER (Person/Org/Date) → Relation Extraction → Template Filling →
Structured DB
Example
Input Text (1 sentence): "Elon Musk founded Tesla in 2003 and SpaceX in 2002 in California."
1. IR System (Query: “Elon Musk companies”)
• Process: Index terms → match “Elon”, “Musk”, “Tesla”, “SpaceX” → score doc high.
• Output: Rank 1: [Full document above](User reads entire text to find info)
2. IE System (No query – auto-extract)
• Process:
o NER → Elon Musk (PERSON), Tesla/SpaceX (ORG), 2003/2002 (DATE), California (LOC)
o Relation → (Elon Musk, founded, Tesla, 2003), (Elon Musk, founded, SpaceX, 2002)
• Output (Structured):
Founder Company Year Location
Elon Musk Tesla 2003 California
Elon Musk SpaceX 2002 California
Q7) Explain Question Answering system (QAS) in detail. (with algorithmic
approach) [10M] x2
Q8) Explain the applications of Natural Language processing. [5M]
NLP enables machines to understand, generate, and act on human language; core tasks:
tokenization, parsing, semantics, pragmatics; applications bridge text to decision/action.
1. Machine Translation (MT) Converts text from source to target language preserving meaning, tone,
grammar.
• How: Encoder-decoder (RNN/Transformer) + attention aligns phrases; e.g., "Je t'aime" → "I
love you".
• Use: Google Translate, real-time subtitles, cross-border e-commerce.
• Challenge: Idioms, ambiguity (e.g., "bank" = river/money), low-resource languages.
• Example: Input: "El gato está en el tejado" → Output: "The cat is on the roof".
2. Question Answering (QA) System Extracts or generates precise answers from documents or
knowledge bases for user queries.
• Types:
o Extractive: Span selection (BERT → highlight answer in passage).
o Generative: Free-form answer (T5 → "Paris is the capital of France").
• Use: Chatbots (Siri), exam bots, medical diagnosis support.
• Flow: Query → Retrieve context → Parse → Answer + confidence score.
• Example: Q: "Who wrote 1984?" → A: "George Orwell" (from passage or KB).
3. Information Retrieval (IR) System Finds relevant documents from large collections using queries;
ranks by relevance.
• Core: Inverted index + TF-IDF/BM25 scoring; supports Boolean, phrase, fuzzy search.
• Use: Google Search, library catalogs, legal doc discovery.
• NLP Role: Query expansion ("car" → "auto"), spell correction, semantic search (vector
embeddings).
• Example: Query: "AI ethics" → Returns top papers with high term overlap + citation rank.
4. Sentiment Analysis Detects emotion, opinion, or polarity (positive/negative/neutral) in text.
• Levels: Document, sentence, aspect (e.g., "battery good, screen bad").
• Method: Lexicon (word scores), ML (Naive Bayes), DL (LSTM/BERT on labeled tweets).
• Use: Brand monitoring, movie reviews, stock prediction from news.
• Example: "This phone is amazing but overheats" → Overall: Mixed; Aspect: Performance+,
Heat–.
5. Text Summarization Compresses long text into short, coherent version retaining key info.
• Types:
o Extractive: Picks important sentences (TextRank).
o Abstractive: Paraphrases (BART/T5 generates new text).
• Use: News digests, research paper abstracts, meeting minutes.
• Flow: Preprocess → Score salience → Select/Rewrite → Output.
• Example: Source: "Milo the cat stole fish. Shopkeeper chased. Milo ate on roof." Extractive:
"Milo the cat stole fish... Milo ate on roof." Abstractive: "Milo stole and ate fish after
escaping shopkeeper."