Siksha Sarovar

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

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

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

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

Initializing knowledge base…
Compiling modules 0%

Unit 4 — NLP Applications: Sentiment Analysis, Machine Translation & Question Answering

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

NLP Applications — Sentiment Analysis, Machine Translation & Question Answering

This lesson and the next survey how the concepts across all four units combine into the real-world NLP applications you will encounter and build.

Sentiment Analysis — Recap and Modern Deployment

Covered in depth in Unit 3 (lexicon-based with VADER, ML-based with Naïve Bayes + TF-IDF). In production today, most large-scale sentiment systems use fine-tuned Transformer models (Unit 4) for higher accuracy on nuanced/sarcastic text, while lightweight lexicon methods remain popular for real-time, low-latency applications (e.g. live chat monitoring).

Deployment contextTypical technique used
Real-time social media stream monitoringLexicon-based (VADER) — fast, no GPU needed
Product review analytics dashboardFine-tuned Transformer (higher accuracy, batch processing)
Customer support ticket triageML-based (Naïve Bayes/SVM) — fast, interpretable, good baseline

Machine Translation (MT)

Machine Translation automatically converts text from one language to another. It has evolved through the same historical arc as language modeling itself:

  • Statistical MT used n-gram language models (Unit 2) combined with phrase-translation probability tables learned from parallel bilingual corpora.
  • Neural MT uses an encoder-decoder architecture: an encoder (originally LSTM, now Transformer) reads the source sentence into a representation, and a decoder generates the target-language sentence token by token — the same encoder-decoder pattern used for abstractive summarization (Unit 3).
# Using a pre-trained Transformer-based translation model (Hugging Face)
from transformers import pipeline

translator = pipeline("translation_en_to_fr", model="Helsinki-NLP/opus-mt-en-fr")
result = translator("Natural Language Processing is fascinating.")
print(result[0]['translation_text'])
# "Le traitement du langage naturel est fascinant."

Question Answering (QA)

Question Answering systems return a precise answer to a natural-language question, rather than a list of documents (as a search engine does).

QA TypeDescriptionExample
Extractive QAAnswer is a text span copied directly from a given passageQuestion: "Who created Python?" Passage mentions "Guido van Rossum created Python" → answer extracted verbatim
Open-domain QANo passage given; system must first retrieve relevant documents, then extract/generate the answer"What is the capital of France?" answered from general knowledge
Generative/Abstractive QAAnswer is generated in the model's own words, possibly synthesizing multiple sourcesLLM-based chat assistants
from transformers import pipeline

qa = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
context = "Python was created by Guido van Rossum and released in 1991."
result = qa(question="Who created Python?", context=context)
print(result['answer'])   # "Guido van Rossum"

Notice extractive QA is architecturally similar to Named Entity Recognition (Unit 2) — both are span-identification tasks over a passage, just with a different objective (find entities vs find the answer span).

How These Applications Reuse the Full Course

ApplicationUnits it draws on
Sentiment analysisUnit 1 (preprocessing) + Unit 3 (TF-IDF, Naïve Bayes) + Unit 4 (Transformers)
Machine translationUnit 2 (n-gram LMs, historically) + Unit 4 (encoder-decoder, Transformers)
Question answeringUnit 2 (NER-style span detection) + Unit 4 (contextual embeddings)

The final lesson covers the remaining applications named in the syllabus: text summarization (deepened from Unit 3), chatbots, speech assistants, and generative AI.