NLP Applications — Text Summarization, Chatbots & Speech Assistants
Text Summarization — Modern Deployment
Unit 3 introduced extractive (TF-IDF/TextRank) and abstractive summarization. Today, production summarization systems overwhelmingly use abstractive, Transformer-based models (BART, T5, or LLMs) because they produce more concise, fluent summaries than sentence-extraction methods — at the cost of higher compute and a small risk of hallucinated details, which must be monitored in high-stakes domains (e.g. legal or medical summarization).
Chatbots
A chatbot is a conversational system that combines almost every technique covered in this course into a single pipeline:
| Chatbot Component | Technique Used | Unit |
|---|---|---|
| Understand what the user wants | Intent classification (text classification) | Unit 3 |
| Extract key details ("book a flight to Delhi on 5 August") | Named Entity Recognition | Unit 2 |
| Track conversation history / resolve "it", "that" | Discourse analysis, coreference resolution | Unit 1 |
| Decide how to respond | Dialogue management (rule-based or learned policy) | — |
| Generate a natural-sounding reply | Template filling, retrieval, or LLM generation | Unit 4 |
Two broad chatbot architectures:
| Type | How it works | Example |
|---|---|---|
| Retrieval-based | Picks the best-matching pre-written response from a fixed set, using similarity scoring (recall TF-IDF cosine similarity, Unit 3) | FAQ bots, simple customer-support bots |
| Generative | Generates a novel response token by token using a language model | Modern LLM-powered assistants |
# Simplified intent classification for a chatbot (reusing the Unit 3 pipeline)
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
utterances = ["book a flight to delhi", "reserve a ticket to mumbai",
"what is the weather today", "will it rain tomorrow",
"cancel my order", "i want to cancel my booking"]
intents = ["book_flight", "book_flight", "check_weather", "check_weather", "cancel_order", "cancel_order"]
intent_classifier = Pipeline([
('tfidf', TfidfVectorizer()),
('clf', MultinomialNB())
])
intent_classifier.fit(utterances, intents)
print(intent_classifier.predict(["book me a ticket to goa"])) # ['book_flight']
Speech Assistants
Speech assistants (Alexa, Siri, Google Assistant) add speech recognition and speech synthesis around the same NLP core used by text chatbots:
- ASR (Automatic Speech Recognition) converts spoken audio into text — internally, ASR systems also use language models (Unit 2) to disambiguate acoustically similar phrases (e.g. "recognize speech" vs "wreck a nice beach") by picking the more probable word sequence.
- Once converted to text, the entire NLP pipeline from this course applies unchanged: preprocessing, intent classification, entity extraction, and response generation.
- TTS (Text-to-Speech) converts the generated text response back into natural-sounding audio.
Why This Matters — The Full Picture
Every application in this lesson is not a separate topic — it is a composition of the individual techniques taught across all four units: preprocessing (Unit 1) cleans the input, POS/NER/parsing (Unit 2) extract structure, feature extraction and classification (Unit 3) understand intent and sentiment, and embeddings/Transformers/LLMs (Unit 4) provide the contextual understanding and generation capability that ties it all together into a working system.