Chapter 1
1. List examples of real-world applications of NLP
• Email platforms:
o Spam classification, priority inbox, calendar event extraction, auto-complete (e.g., Gmail, Outlook).
• Voice-based assistants:
o Apple Siri, Google Assistant, Amazon Alexa, Microsoft Cortana.
• Modern Search engines:
o Query understanding, query expansion, question answering, information retrieval (e.g., Google, Bing).
• Machine translation:
o Google Translate, Bing Microsoft Translator, Amazon Translate.
Other applications:
• Analyze their social media feeds:
o Build a better and deeper understanding of the voice of their customers.
• E-commerce platforms:
o Product description extraction, review analysis (e.g., Amazon).
• Healthcare, finance, and law
• Companies such as Arria:
o Automating report generation, legal document analysis, financial forecasting.
• Spelling and grammar correction:
o Grammarly, Microsoft Word, Google Docs.
• IBM Watson: An AI built using NLP techniques that competed on "Jeopardy!" quiz show and won $1 million,
outperforming human champions.
• Educational tools:
o Automated scoring (e.g., GRE)
o plagiarism detection (e.g., Turnitin)
o language learning apps (e.g., Duolingo)
• Knowledge bases:
o Google Knowledge Graph for search and question answering.
1
2. Explain the following NLP tasks
• Language modeling:
o Predicting the next word in a sequence based on previous words.
o Used in speech recognition, machine translation, and spelling correction.
• Text classification:
o Categorizing text into predefined classes (e.g., spam detection, sentiment analysis).
• Information extraction:
o Extracting structured information from unstructured text (e.g., extracting names,or events from emails).
• Information retrieval:
o Finding relevant documents from a large collection (e.g., search engines).
• Conversational agent:
o Building systems that can converse with humans (e.g., chatbots, voice assistants).
• Text summarization:
o Creating concise summaries of long documents while retaining key information.
• Question answering:
o Building systems that can answer questions posed in natural language.
• Machine translation:
o Translating text from one language to another (e.g., Google Translate).
• Topic modeling:
o Identifying latent topics in a large collection of documents (e.g., identifying themes ).
2
3. What are the building blocks of language and their applications?
• Phonemes:
o Smallest units of sound in a language.
o Used in speech recognition and text-to-speech systems.
• Morphemes and lexemes:
o Smallest units of meaning.
o Used in tokenization, stemming, and part-of-speech tagging.
• Syntax:
o Rules for constructing grammatically correct sentences.
o Used in parsing and sentence structure analysis.
• Context:
o Meaning derived from semantics and pragmatics.
o Used in tasks like sarcasm detection, summarization, and topic modeling.
4. Why is NLP challenging?
• Ambiguity: Words and sentences can have multiple meanings depending on context.
• Common knowledge: Humans rely on implicit knowledge that machines lack.
• Creativity: Language includes creative elements like poetry, metaphors, and idioms.
• Diversity across languages: No direct mapping between vocabularies of different languages.
• Complexity of human language: Syntax, semantics, and pragmatics make language processing difficult for
machines.
3
5. How NLP, ML, and DL are related?
• AI: Broad field aiming to build systems that perform tasks requiring human intelligence.
• ML: Subfield of AI that learns patterns from data without explicit programming.
• DL: Subfield of ML based on neural networks to model complex patterns.
• NLP: Subfield of AI focused on language processing, often using ML and DL techniques.
6. Describe the heuristics-based NLP
• Rule-Based Systems: Early NLP systems relied on handcrafted rules and resources like dictionaries and
thesauruses.
• Lexicon-Based Sentiment Analysis: Uses counts of positive and negative words to deduce sentiment.
• Knowledge Bases: WordNet (synonyms, hyponyms, meronyms), Open Mind Common Sense.
• Regex and CFG: Regular expressions and context-free grammars for text analysis.
7. Explain briefly Naive Bayes, Support Vector Machine, Hidden Markov Model, and Conditional Random
Fields approaches
• Naive Bayes: A probabilistic classifier based on Bayes’ theorem. Assumes feature independence. Used in text
classification.
• Support Vector Machine (SVM): A classifier that finds the optimal decision boundary between classes. Used in
text classification.
• Hidden Markov Model (HMM): A statistical model for sequential data. Used in part-of-speech tagging.
• Conditional Random Fields (CRF): A sequential classifier that considers context. Used in named entity
recognition and part-of-speech tagging.
4
8. What is the difference between RNN and LSTM NN?
• RNN: Processes sequential data but struggles with long-term dependencies due to the vanishing gradient
problem.
• LSTM: A variant of RNN that uses memory cells to retain long-term context, making it more effective for longer
sequences.
9. How CNN can be used for text processing?
• CNNs process text by converting words into 2D word vectors of dimension n ✕ d, forming a matrix.
o n : number of words in the sentence , d : size of the word vectors.
• This matrix can be treated similar to an image and can be modeled by a CNN
• Convolution filters capture local patterns (e.g., n-grams).
• pooling layers condense features, and fully connected layers classify the text.
• This makes CNNs effective for tasks like sentiment analysis and text classification.
10. Describe the concept of transfer learning
• Applying knowledge learned from one task to a different but related task.
• Example: Pre-training a large model (e.g., BERT) on a massive dataset, then fine-tuning it for specific NLP tasks
like text classification or question answering.
11. Give the architecture of autoencoder
• Input Layer: Takes in text data.
• Hidden Layer (Encoder): Compresses the input into a dense vector representation.
• Output Layer (Decoder): Reconstructs the input from the compressed representation.
• Purpose: Used for unsupervised learning of feature representations.
5
12. List the key reasons that make DL not suitable for all NLP tasks
• Overfitting on Small Datasets: DL models require large amounts of data.
• Few-Shot Learning: DL struggles with learning from very few examples.
• Domain Adaptation: DL models trained on one domain may not generalize well to another.
• Interpretability: DL models are often black boxes, making it hard to explain predictions.
• Cost: DL models are expensive to train and deploy.
• On-Device Deployment: DL models may not fit on devices with limited memory and power.
13. Explain the flow of conversation agents
• Speech recognition: Converts speech to text.
• Natural language understanding: Analyzes text for sentiment, entities, and intent.
• Dialog management: Determines the user’s intent and decides the next action.
• Response generation: Generates a response (e.g., retrieving information or performing an action).