🌍 Data Science · subject

Data Science Natural Language Processing (NLP) Syllabus

The Natural Language Processing (NLP) syllabus for Data Science in full: 7 chapters, 21 topics and 57 sub-topics, every one listed below, plus 51 Natural Language Processing (NLP) flashcards with answers.

7Chapters
21Topics
57Sub-topics
51Flashcards

Natural Language Processing (NLP) syllabus: all 7 chapters

Expand any chapter to see its topics and sub-topics.

  1. Introduction to Natural Language Processing (NLP)

    3 topics
    • What is NLP?
      • Definition and Scope
      • History and Evolution
    • Applications of NLP
      • Text Classification
      • Sentiment Analysis
      • Machine Translation
      • Chatbots and Conversational Agents
      • Speech Recognition
    • Challenges in NLP
      • Ambiguity
      • Context and Pragmatics
      • Resource Scarcity
  2. Basic Linguistics for NLP

    3 topics
    • Syntax
      • Parts of Speech
      • Phrase Structure
    • Semantics
      • Meaning Representation
      • Lexical Semantics
    • Pragmatics
      • Contextual Meaning
      • Speech Acts
  3. Text Preprocessing

    3 topics
    • Tokenization
      • Word Tokenization
      • Sentence Tokenization
    • Normalization
      • Lowercasing
      • Stemming
      • Lemmatization
    • Removing Noise
      • Stop Words
      • Punctuation
      • Special Characters
  4. Feature Extraction

    3 topics
    • Bag of Words (BoW)
      • Term Frequency
      • Inverse Document Frequency (IDF)
    • TF-IDF
      • Calculation
      • Applications
    • Word Embeddings
      • Word2Vec
      • GloVe
      • FastText
  5. NLP Algorithms

    3 topics
    • Text Classification
      • Naive Bayes
      • Support Vector Machines (SVM)
      • Neural Networks
    • Sequence Models
      • Hidden Markov Models (HMMs)
      • Conditional Random Fields (CRFs)
    • Neural Networks for NLP
      • Recurrent Neural Networks (RNNs)
      • Long Short-Term Memory (LSTM)
      • Gated Recurrent Units (GRUs)
  6. Advanced NLP Techniques

    3 topics
    • Transformers
      • Attention Mechanism
      • BERT
      • GPT
    • Transfer Learning in NLP
      • Pre-trained Models
      • Fine-Tuning
    • Evaluation Metrics
      • Precision, Recall, F1-Score
      • BLEU Score
      • ROUGE Score
  7. NLP in Practice

    3 topics
    • NLP Libraries and Frameworks
      • NLTK
      • spaCy
      • Hugging Face Transformers
    • Building NLP Pipelines
      • Data Collection
      • Preprocessing
      • Model Training
      • Evaluation and Deployment
    • Case Studies
      • Sentiment Analysis in Social Media
      • Machine Translation at Scale
      • Chatbots for Customer Service

Data Science Natural Language Processing (NLP) flashcards — 51 questions with answers

  1. What is Natural Language Processing (NLP)?

    NLP is a subfield of artificial intelligence and linguistics concerned with enabling computers to understand, interpret, generate, and respond to human (natural) language in text or speech form.

  2. What are the two broad subfields that NLP combines techniques from?

    NLP combines computational linguistics (rule-based modeling of language) with machine learning, deep learning, and statistical models.

  3. Distinguish Natural Language Understanding (NLU) from Natural Language Generation (NLG).

    NLU focuses on machine reading comprehension — mapping language to meaning (intent, entities). NLG focuses on producing fluent, coherent natural language text from structured data or internal representations.

  4. List four common real-world applications of NLP.

    Machine translation, sentiment analysis, chatbots/virtual assistants, spam detection, text summarization, named-entity recognition, speech recognition, and autocomplete/autocorrect.

  5. What NLP application assigns a polarity (positive, negative, neutral) to a piece of text?

    Sentiment analysis (opinion mining).

  6. Name three major challenges that make NLP difficult.

    Ambiguity (lexical, syntactic, semantic), context dependence, sarcasm/irony, idioms and figurative language, spelling/grammatical errors, language diversity, and coreference resolution.

  7. What is lexical ambiguity? Give the type of word it involves.

    Lexical ambiguity occurs when a single word has multiple meanings (polysemy/homonymy), e.g. 'bank' meaning a riverbank or a financial institution.

  8. What is syntactic (structural) ambiguity?

    When a sentence can be parsed into more than one grammatical structure, yielding different meanings, e.g. 'I saw the man with the telescope.'

  9. In linguistics/NLP, what does syntax refer to?

    Syntax is the set of rules governing the grammatical arrangement of words and phrases to form valid sentences — sentence structure, not meaning.

  10. What is semantics in NLP?

    Semantics is the study of meaning — the literal meaning of words, phrases, and sentences independent of context.

  11. What is pragmatics in NLP?

    Pragmatics is the study of how context, speaker intent, and real-world knowledge affect the interpretation of language beyond its literal meaning.

  12. Order these three from form to context: semantics, pragmatics, syntax.

    Syntax (structure/form) → Semantics (literal meaning) → Pragmatics (contextual/intended meaning).

  13. What is tokenization in NLP?

    Tokenization is the process of breaking text into smaller units called tokens — typically words, subwords, or characters — for further processing.

  14. Differentiate word tokenization from subword tokenization.

    Word tokenization splits text on word boundaries (whitespace/punctuation). Subword tokenization (e.g. Byte-Pair Encoding, WordPiece) splits words into smaller frequent units to handle rare and out-of-vocabulary words.

  15. What is text normalization?

    Normalization transforms text into a single canonical form, e.g. lowercasing, expanding contractions, converting numbers/dates to standard formats, and reducing words to base forms.

  16. Compare stemming and lemmatization.

    Stemming crudely chops word endings to a root using heuristics (e.g. 'studies' → 'studi'), possibly non-words. Lemmatization uses vocabulary and morphology to return the valid dictionary base form/lemma (e.g. 'studies' → 'study').

  17. What are stop words and why are they often removed?

    Stop words are very common words (the, is, at, and) that carry little discriminative meaning; removing them reduces dimensionality and noise in many bag-of-words style models.

  18. What is meant by 'removing noise' in text preprocessing?

    Eliminating irrelevant or distracting elements such as HTML tags, punctuation, special characters, URLs, extra whitespace, and emojis that do not contribute to the analysis.

  19. What is the Bag of Words (BoW) model?

    BoW represents a document as an unordered multiset of its words, recording word counts (or presence) while discarding grammar and word order.

  20. State one key limitation of the Bag of Words model.

    BoW ignores word order and context, produces high-dimensional sparse vectors, and treats all words as independent, so it cannot capture semantic similarity between words.

Show the other 31 Natural Language Processing (NLP) flashcards
  1. What does TF-IDF stand for?

    Term Frequency–Inverse Document Frequency.

  2. Write the formula for Term Frequency (TF) of term $t$ in document $d$.

    $$\text{TF}(t,d) = \frac{f_{t,d}}{\sum_{t' \in d} f_{t',d}}$$ where $f_{t,d}$ is the raw count of term $t$ in document $d$.

  3. Write a common formula for Inverse Document Frequency (IDF) of term $t$.

    $$\text{IDF}(t) = \log\!\left(\frac{N}{1 + n_t}\right)$$ where $N$ is the total number of documents and $n_t$ is the number of documents containing $t$.

  4. How is the TF-IDF weight computed and what does a high value indicate?

    $\text{TF-IDF}(t,d) = \text{TF}(t,d) \times \text{IDF}(t)$. A high value means the term is frequent in the document but rare across the corpus, making it highly discriminative.

  5. What are word embeddings?

    Word embeddings are dense, low-dimensional real-valued vector representations of words learned so that semantically similar words lie close together in the vector space.

  6. Name two classic word-embedding algorithms.

    Word2Vec (Skip-gram and CBOW) and GloVe (Global Vectors); fastText is another that uses subword information.

  7. Contrast the CBOW and Skip-gram architectures of Word2Vec.

    CBOW predicts the target word from its surrounding context words; Skip-gram predicts the surrounding context words from a given target word. Skip-gram works better for rare words.

  8. What famous vector arithmetic example illustrates that embeddings capture analogies?

    $$\vec{\text{king}} - \vec{\text{man}} + \vec{\text{woman}} \approx \vec{\text{queen}}$$

  9. What similarity measure is typically used to compare two word embeddings?

    Cosine similarity: $$\cos(\theta) = \frac{\vec{a}\cdot\vec{b}}{\lVert\vec{a}\rVert\,\lVert\vec{b}\rVert}$$

  10. What is text classification?

    Text classification is the task of assigning predefined category labels to text documents, e.g. spam vs. not spam, topic labeling, or sentiment categories.

  11. Name a simple probabilistic algorithm commonly used as a text-classification baseline and the assumption it makes.

    Naive Bayes; it assumes conditional independence of features (words) given the class label.

  12. State Bayes' theorem as used in a Naive Bayes text classifier.

    $$P(c \mid d) = \frac{P(d \mid c)\,P(c)}{P(d)}$$ where $c$ is a class and $d$ is a document; classification picks the class maximizing $P(c)\prod_i P(w_i \mid c)$.

  13. What are sequence models in NLP and why are they used?

    Sequence models process ordered sequences of tokens, maintaining information about order and context. They are used for tasks like language modeling, translation, and tagging where word order matters.

  14. What is a Recurrent Neural Network (RNN)?

    An RNN is a neural network that processes sequences one element at a time, maintaining a hidden state that is updated at each step to carry information from previous tokens.

  15. What problem do vanilla RNNs suffer from with long sequences?

    The vanishing (and exploding) gradient problem, which prevents them from learning long-range dependencies.

  16. How do LSTM networks address the limitations of vanilla RNNs?

    LSTMs use a cell state and gating mechanisms (input, forget, and output gates) to control information flow, allowing them to retain long-range dependencies and mitigate vanishing gradients.

  17. What are the three gates in an LSTM cell?

    The forget gate, the input gate, and the output gate.

  18. How does a GRU differ from an LSTM?

    A Gated Recurrent Unit (GRU) is a simplified gated RNN with only two gates (reset and update) and no separate cell state, making it computationally lighter while often performing comparably.

  19. Why are neural networks well suited to NLP compared to classical bag-of-words methods?

    They learn dense distributed representations, capture nonlinear patterns and context, share parameters across positions, and reduce manual feature engineering.

  20. What is a Convolutional Neural Network (CNN) used for in NLP?

    CNNs apply convolutional filters over sequences of word embeddings to detect local n-gram patterns, useful for tasks like sentence/text classification.

  21. What is the Transformer architecture?

    The Transformer is a neural architecture introduced in 'Attention Is All You Need' (2017) that relies entirely on self-attention mechanisms (no recurrence or convolution) to model relationships between all tokens in parallel.

  22. What is the core mechanism that powers Transformers?

    Self-attention (scaled dot-product attention), which lets each token attend to and weight every other token in the sequence.

  23. Write the scaled dot-product attention formula.

    $$\text{Attention}(Q,K,V) = \text{softmax}\!\left(\frac{QK^{\top}}{\sqrt{d_k}}\right)V$$ where $Q$, $K$, $V$ are query, key, and value matrices and $d_k$ is the key dimension.

  24. Why is the dot product scaled by $\frac{1}{\sqrt{d_k}}$ in attention?

    To counteract large dot-product magnitudes for high $d_k$ that would push the softmax into regions with extremely small gradients, stabilizing training.

  25. Why do Transformers require positional encoding?

    Because self-attention is order-invariant, positional encodings (e.g. sinusoidal functions) are added to embeddings to inject information about token position in the sequence.

  26. What is transfer learning in NLP?

    Transfer learning pretrains a model on a large general corpus to learn language representations, then fine-tunes it on a smaller task-specific dataset, transferring knowledge to improve performance with less data.

  27. Contrast BERT and GPT in terms of their pretraining direction.

    BERT is a bidirectional encoder pretrained with masked-language modeling (sees both left and right context). GPT is a unidirectional (autoregressive) decoder pretrained to predict the next token left-to-right.

  28. For a classification model, define precision and recall.

    Precision $= \frac{TP}{TP+FP}$ (fraction of predicted positives that are correct); Recall $= \frac{TP}{TP+FN}$ (fraction of actual positives correctly identified).

  29. Write the formula for the F1 score and explain what it balances.

    $$F_1 = 2\cdot\frac{\text{precision}\cdot\text{recall}}{\text{precision}+\text{recall}}$$ It is the harmonic mean of precision and recall, balancing the two.

  30. What evaluation metric is commonly used for machine translation, and what does a higher value mean?

    BLEU (Bilingual Evaluation Understudy) measures n-gram overlap between machine output and reference translations; a higher BLEU score (closer to 1 or 100) indicates closer match to human references.

  31. What is perplexity and how is it used to evaluate language models?

    Perplexity measures how well a probability model predicts a sample; for a language model it is $$\text{PP}(W) = P(w_1,\dots,w_N)^{-\frac{1}{N}} = \exp\!\left(-\frac{1}{N}\sum_{i=1}^{N}\ln P(w_i \mid w_{<i})\right).$$ Lower perplexity indicates a better model.

Data Science Natural Language Processing (NLP) FAQ

What is in the Data Science Natural Language Processing (NLP) syllabus?

Data Science Natural Language Processing (NLP) is split into 7 chapters: Introduction to Natural Language Processing (NLP), Basic Linguistics for NLP, Text Preprocessing, Feature Extraction, NLP Algorithms, Advanced NLP Techniques and NLP in Practice. Together they contain 21 topics and 57 sub-topics.

How many chapters are in Data Science Natural Language Processing (NLP)?

7 chapters, containing 21 topics and 57 sub-topics. The largest chapter is Introduction to Natural Language Processing (NLP), with 3 topics.

Are there flashcards for Data Science Natural Language Processing (NLP)?

Yes — a 51-card Natural Language Processing (NLP) deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.