🌍 Machine Learning · subject
Machine Learning Natural Language Processing Syllabus
The Natural Language Processing syllabus for Machine Learning in full: 10 chapters and 51 topics, every one listed below, plus 50 Natural Language Processing flashcards with answers.
Natural Language Processing syllabus: all 10 chapters
Expand any chapter to see its topics and sub-topics.
-
Introduction to NLP
3 topics- Definition and Applications
- History of NLP
- Challenges in NLP
-
Text Preprocessing
6 topics- Tokenization
- Stop Words Removal
- Stemming and Lemmatization
- Text Normalization
- Part-of-Speech Tagging
- Named Entity Recognition
-
Feature Extraction
6 topics- Bag of Words
- TF-IDF
- Word Embeddings
- Word2Vec
- GloVe
- FastText
-
Language Models
7 topics- N-grams
- Recurrent Neural Networks (RNNs)
- Long Short-Term Memory Networks (LSTMs)
- Gated Recurrent Units (GRUs)
- Transformers
- BERT
- GPT
-
Text Classification
6 topics- Naive Bayes Classifier
- Support Vector Machines
- Decision Trees
- Random Forests
- Neural Networks
- Evaluation Metrics
-
Sequence-to-Sequence Tasks
4 topics- Machine Translation
- Text Summarization
- Question Answering
- Chatbots
-
Advanced NLP Techniques
5 topics- Attention Mechanisms
- Self-Attention
- Transfer Learning in NLP
- Pre-trained Models
- Fine-Tuning Models
-
NLP Libraries and Tools
6 topics- NLTK
- spaCy
- Gensim
- Hugging Face Transformers
- OpenNLP
- Stanford NLP
-
Ethics and Bias in NLP
4 topics- Bias in Data
- Bias in Models
- Mitigating Bias
- Ethical Considerations
-
NLP in Practice
4 topics- Building NLP Pipelines
- Deploying NLP Models
- Case Studies
- Future Trends in NLP
Machine Learning Natural Language Processing flashcards — 50 questions with answers
What is Natural Language Processing (NLP)?
NLP is a subfield of artificial intelligence and computational linguistics concerned with enabling computers to understand, interpret, generate, and manipulate human (natural) language in both text and speech form.
Name four common real-world applications of NLP.
Machine translation, sentiment analysis, chatbots/virtual assistants, spam detection, speech recognition, text summarization, and question answering (any four).
In NLP, what is the difference between Natural Language Understanding (NLU) and Natural Language Generation (NLG)?
NLU focuses on machine reading comprehension — extracting meaning, intent, and structure from input language. NLG focuses on producing coherent, human-readable language as output from structured data or internal representations.
What landmark 1950 paper/test is considered a starting point of NLP and AI, and who proposed it?
The Turing Test, proposed by Alan Turing in his paper 'Computing Machinery and Intelligence' (1950), which judged machine intelligence by its ability to converse indistinguishably from a human.
What was ELIZA, and when was it created?
ELIZA was an early rule-based chatbot created by Joseph Weizenbaum at MIT in 1966 that simulated a Rogerian psychotherapist using simple pattern matching and substitution rules.
Describe the three major historical paradigms of NLP in order.
1) Symbolic/rule-based NLP (1950s–1980s, hand-crafted grammar rules); 2) Statistical NLP (late 1980s–2000s, probabilistic models learned from corpora); 3) Neural/deep learning NLP (2010s–present, embeddings, RNNs, and Transformers).
Why is ambiguity a central challenge in NLP? Give the main types.
Natural language allows multiple interpretations. Key types: lexical ambiguity (a word with multiple meanings, e.g. 'bank'), syntactic/structural ambiguity (multiple parse trees), and semantic/referential ambiguity (unclear pronoun reference or meaning).
What linguistic phenomenon does the sentence 'I saw the man with the telescope' illustrate?
Syntactic (structural) ambiguity — it is unclear whether 'with the telescope' attaches to the act of seeing or describes the man.
List three challenges in NLP beyond ambiguity.
Context dependence, sarcasm/irony detection, handling of synonyms and polysemy, language diversity and low-resource languages, spelling/grammar errors, idioms, and coreference resolution (any three).
What is tokenization in NLP?
Tokenization is the process of splitting raw text into smaller units called tokens (typically words, subwords, or characters), which serve as the basic units for further processing.
Distinguish word tokenization from subword tokenization, and name a subword algorithm.
Word tokenization splits text into whole words; subword tokenization breaks words into smaller meaningful units to handle rare/unknown words and reduce vocabulary size. Example algorithm: Byte-Pair Encoding (BPE), WordPiece, or SentencePiece.
Why can tokenization be difficult in languages like Chinese or Japanese?
These languages typically do not use whitespace to separate words, so word boundaries must be inferred algorithmically rather than read off delimiters.
What are stop words, and why are they often removed?
Stop words are extremely common words (e.g. 'the', 'is', 'and', 'of') that carry little discriminative meaning. They are removed to reduce dimensionality and noise, focusing on more informative content words.
Give one situation where removing stop words is harmful.
In tasks like sentiment analysis or machine translation, words such as 'not' or 'no' are critical for meaning; removing them can flip or destroy the intended sense (e.g. 'not good' becoming 'good').
What is stemming?
Stemming is a heuristic process that crudely chops word endings to reduce inflected words to a common root (stem), which may not be a valid dictionary word (e.g. 'studies' -> 'studi').
What is lemmatization, and how does it differ from stemming?
Lemmatization reduces a word to its dictionary base form (lemma) using vocabulary and morphological analysis, considering part of speech (e.g. 'better' -> 'good'). Unlike stemming, it produces valid words and is more accurate but computationally heavier.
Name a classic stemming algorithm for English.
The Porter stemmer (Porter stemming algorithm); other examples include the Snowball (Porter2) and Lancaster stemmers.
Apply stemming vs lemmatization to the word 'caring'.
Stemming typically yields 'car' (incorrect crude chop in some stemmers) or 'care'; lemmatization (with verb POS) yields 'care', the correct base form.
What is text normalization in NLP?
Text normalization transforms text into a single canonical form, including lowercasing, removing punctuation/special characters, expanding contractions and abbreviations, converting numbers/dates to standard forms, and correcting spelling.
Why is lowercasing during normalization sometimes undesirable?
Lowercasing can erase meaningful distinctions — e.g. 'US' (country) vs 'us' (pronoun), or 'Apple' (company) vs 'apple' (fruit) — which hurts tasks like named entity recognition.
Show the other 30 Natural Language Processing flashcards
What is Part-of-Speech (POS) tagging?
POS tagging assigns each token a grammatical category (such as noun, verb, adjective, adverb, pronoun, preposition) based on its definition and context within the sentence.
Name two classic models used for POS tagging.
Hidden Markov Models (HMMs) and Conditional Random Fields (CRFs); also rule-based taggers and modern neural (BiLSTM) taggers.
In POS tagging, why is context necessary? Give an example.
The same word can have different tags depending on use. E.g. 'book' is a noun in 'read a book' but a verb in 'book a flight'; the surrounding words disambiguate the correct tag.
What is Named Entity Recognition (NER)?
NER is the task of locating and classifying named entities in text into predefined categories such as person, organization, location, date, time, monetary value, and percentage.
What does the BIO (IOB) tagging scheme represent in NER?
It labels tokens as B- (Beginning of an entity), I- (Inside/continuation of an entity), or O (Outside any entity), allowing multi-token entities to be marked, e.g. 'New(B-LOC) York(I-LOC)'.
In the sentence 'Apple was founded in Cupertino in 1976', identify the named entities and their types.
'Apple' = Organization, 'Cupertino' = Location (GPE), '1976' = Date.
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. Each document becomes a vector over the vocabulary.
State two key limitations of the Bag of Words model.
It ignores word order/context (so 'dog bites man' equals 'man bites dog') and produces high-dimensional sparse vectors that capture no semantic similarity between different words.
What does TF-IDF stand for, and what is its purpose?
Term Frequency–Inverse Document Frequency. It weights terms so that words frequent in a document but rare across the corpus get high scores, highlighting words that are distinctive to a document.
Give 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$ (sometimes TF is just the raw count $f_{t,d}$).
Give the standard formula for Inverse Document Frequency (IDF) of term $t$.
$$\text{IDF}(t) = \log\frac{N}{n_t}$$ where $N$ is the total number of documents and $n_t$ is the number of documents containing term $t$. A smoothed variant is $\log\frac{N}{1+n_t}$.
Write the full TF-IDF weight of term $t$ in document $d$.
$$\text{TF-IDF}(t,d) = \text{TF}(t,d) \times \text{IDF}(t) = \text{TF}(t,d)\cdot \log\frac{N}{n_t}$$
In TF-IDF, what score does a word that appears in every document receive, and why?
Its IDF is $\log\frac{N}{N} = \log 1 = 0$, so its TF-IDF weight is $0$ — such ubiquitous words are treated as non-discriminative.
What are word embeddings?
Word embeddings are dense, low-dimensional real-valued vector representations of words learned so that semantically/syntactically similar words have nearby vectors, capturing meaning from distributional context.
What is the distributional hypothesis that underlies word embeddings?
'You shall know a word by the company it keeps' — words that occur in similar contexts tend to have similar meanings, so context co-occurrence can encode semantics.
How does the similarity between two word embedding vectors $\vec{a}$ and $\vec{b}$ commonly get measured?
By cosine similarity: $$\cos(\theta) = \frac{\vec{a}\cdot\vec{b}}{\lVert\vec{a}\rVert\,\lVert\vec{b}\rVert}$$ which ranges from $-1$ to $1$, with values near $1$ meaning highly similar.
What famous analogy result demonstrates the linear structure of word embeddings?
$\vec{king} - \vec{man} + \vec{woman} \approx \vec{queen}$ — vector arithmetic on embeddings captures relational/semantic analogies.
What is Word2Vec, and who introduced it?
Word2Vec is a shallow neural network method for learning word embeddings from large corpora, introduced by Tomas Mikolov and colleagues at Google in 2013.
Name and distinguish the two architectures of Word2Vec.
CBOW (Continuous Bag of Words) predicts the target/center word from its surrounding context words; Skip-gram predicts the surrounding context words given the center word. Skip-gram works better for rare words; CBOW is faster.
What training optimizations make Word2Vec efficient?
Negative sampling (only updating a small sample of negative words instead of the full softmax) and hierarchical softmax, which avoid computing the expensive full-vocabulary softmax.
What is GloVe, and how does its approach differ from Word2Vec?
GloVe (Global Vectors), from Stanford (Pennington et al., 2014), learns embeddings by factorizing a global word–word co-occurrence count matrix, using corpus-wide statistics, whereas Word2Vec is a local prediction (window-based) method.
What quantity does GloVe primarily model to learn embeddings?
Ratios of word–word co-occurrence probabilities; its objective relates the dot product of word vectors to the logarithm of their co-occurrence count, $\vec{w_i}\cdot\vec{w_j} \approx \log(X_{ij})$.
What is FastText, and what is its key innovation over Word2Vec?
FastText (Facebook AI, 2016) represents each word as a bag of character n-grams and sums their vectors. This lets it build embeddings for out-of-vocabulary words and capture subword/morphological information.
How does FastText handle out-of-vocabulary (OOV) words, unlike Word2Vec and GloVe?
It composes an OOV word's vector from its character n-gram subword vectors, so even unseen words get meaningful embeddings, whereas Word2Vec/GloVe have no vector for unseen words.
What is an n-gram?
An n-gram is a contiguous sequence of $n$ items (typically words or characters) from a text. For example, in 'natural language processing': unigrams are single words, bigrams are 'natural language' and 'language processing'.
In an n-gram language model, what does the Markov assumption state?
The probability of a word depends only on the previous $n-1$ words: $$P(w_i \mid w_1,\dots,w_{i-1}) \approx P(w_i \mid w_{i-n+1},\dots,w_{i-1})$$
Why is smoothing (e.g. Laplace/add-one) needed in n-gram models?
To assign nonzero probability to n-grams not seen in the training data, avoiding zero probabilities for valid but unobserved word sequences.
What is a Recurrent Neural Network (RNN), and why is it suited to NLP?
An RNN is a neural network that processes sequences one element at a time while maintaining a hidden state that carries information from previous steps, making it suited to variable-length sequential data like text. Its update is $$h_t = \tanh(W_h h_{t-1} + W_x x_t + b)$$
What is the vanishing/exploding gradient problem in RNNs?
During backpropagation through time, gradients can shrink toward $0$ (vanishing) or grow without bound (exploding) over many time steps, making it hard for vanilla RNNs to learn long-range dependencies.
What is an LSTM, and how does it address the RNN limitation?
A Long Short-Term Memory network is a gated RNN variant that uses a cell state plus input, forget, and output gates to regulate information flow, preserving long-range dependencies and mitigating the vanishing gradient problem. The forget gate is $f_t = \sigma(W_f[h_{t-1}, x_t] + b_f)$.
Machine Learning Natural Language Processing FAQ
What is in the Machine Learning Natural Language Processing syllabus?
Machine Learning Natural Language Processing is split into 10 chapters: Introduction to NLP, Text Preprocessing, Feature Extraction, Language Models, Text Classification, Sequence-to-Sequence Tasks, Advanced NLP Techniques, NLP Libraries and Tools, Ethics and Bias in NLP and NLP in Practice. Together they contain 51 topics.
How many chapters are in Machine Learning Natural Language Processing?
10 chapters, containing 51 topics. The largest chapter is Language Models, with 7 topics.
Are there flashcards for Machine Learning Natural Language Processing?
Yes — a 50-card Natural Language Processing 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.