Topic: semantic meaning in sparse representations · one-hot vectors · bag-of-words · out-of-vocabulary (OOV) · vocabulary vs corpus
Questions: 10 MCQ (full options available)
Source: class WhatsApp group (Chats/WhatsApp-Cheat-code/chat.md), set "AML – Assignment Questions & Correct Answers" (4 Nov 2026).
Verification: ✅ all 10 marked answers re-checked. Q5 is flagged ⚠️ ambiguous in the source — see the note.
Quick answer key
| Q | Answer | Q | Answer |
|---|---|---|---|
| 1 | c — semantic meaning lost in both | 6 | a — lost after tokenisation |
| 2 | c — binary numerical vector | 7 | b — always non-zero |
| 3 | a — both suffer OOV | 8 | c — all of them |
| 4 | d — may be zero | 9 | c — numerical representation |
| 5 | a — order matters in one-hot only (ambiguous) | 10 | c — none |
Q1. Semantic Meaning in One-Hot Encoding and Bag-of-Words
a. Semantic meaning of the text is maintained in One-Hot Encoding and Bag-of-Words. b. Semantic meaning of the text is not maintained in One-Hot Encoding but maintained in Bag-of-Words. c. Semantic meaning of the text is not maintained in One-Hot Encoding and Bag-of-Words. d. Semantic meaning of the text is maintained in One-Hot Encoding but not in Bag-of-Words.
✅ Correct: c
Both are count-based, order-less representations. One-hot gives each word a slot with a 1; BoW counts word frequencies. Neither knows that "cat" and "dog" are similar, nor that "not good" differs from "good" — that is exactly what embeddings (word2vec, GloVe) were invented to fix. Related: distributional semantics is the property that is lost; the "distributional" module in the course is about recovering it.
Q2. One-Hot Encoding
a. Offers a binary categorical vector as output. b. Offers a sparse vector as output. c. Offers a binary numerical vector as output. d. Offers a continuous vector as output.
✅ Correct: c
The vector is binary (0/1) and numerical — the intended contrast is with "categorical" (a). Watch out: option b is also literally true (the vector is sparse), which is why the examiners' intended answer is the more specific "binary numerical". Flag it if the paper is challenged.
Q3. Out-of-Vocabulary (OOV) Problem
a. One-Hot Encoding and Bag-of-Words both suffer from the OOV problem. b. One-Hot Encoding and Bag-of-Words both do not suffer from the OOV problem. c. One-Hot Encoding does not suffer but Bag-of-Words suffers from the OOV problem. d. One-Hot Encoding suffers but Bag-of-Words does not suffer from the OOV problem.
✅ Correct: a
Both build their vocabulary from the training corpus. Any token never seen in training has no slot/column, so it cannot be represented at inference — that is OOV. Related: subword (character n-gram) tokenisation and <UNK> tokens are the standard mitigations; fastText/subword embeddings address it by construction.
Q4. Summation of Bag-of-Words Vector
a. Summation of all the values of a document Bag-of-Words vector is always zero. b. … is always equal to 1. c. … is always non-zero. d. … may be zero.
✅ Correct: d
An empty document (or one containing only OOV tokens) produces the all-zero vector, so the sum is zero. Any non-empty, in-vocabulary document gives a positive integer count. Hence "may be zero". Related: BoW vectors are unnormalised counts; length-normalisation (or TF-IDF) is applied afterwards so the sum is no longer the raw word count.
Q5. Sequence/Order of Values in Feature Vector
a. The sequence/order of the values in the feature vector matters in One-Hot Encoding but does not matter in Bag-of-Words. b. … matters in One-Hot Encoding and Bag-of-Words. c. … does not matter in One-Hot Encoding but matters in Bag-of-Words. d. … does not matter in One-Hot Encoding and Bag-of-Words.
✅ Correct (as marked): a — ⚠️ ambiguous
The source's key is a. The intended reading is token-level one-hot (each token gets its own slot, so position in the encoded sequence is retained), versus BoW, which collapses everything into counts and loses order entirely. But if "one-hot" means the document-level concatenated vector, the slot order is fixed by the vocabulary for both encodings, and d would be defensible. For the exam, answer a; for understanding: standard one-hot and BoW both discard word order — only sequence models (n-grams, RNNs, transformers) keep it.
Q6. Semantic Meaning After Tokenisation
a. Semantic meaning of the text is not maintained after tokenisation. b. … is maintained after tokenisation if Bag-of-Words is used. c. … is maintained after tokenisation if One-Hot Encoding is used. d. … is maintained after tokenisation.
✅ Correct: a
Tokenisation turns a string into a bag/sequence of symbols; the meaning (reference, negation, similarity) lives in the relations between those symbols, which are not in the list of tokens. Related: the distinction is syntax vs semantics — tokenisation preserves form, not sense.
Q7. Summation of One-Hot Encoding Vector
a. … may be zero. b. … is always non-zero. c. … is always zero. d. … is always equal to 1.
✅ Correct: b
For any non-empty encoded document, each token contributes exactly one 1 → sum = number of tokens ≥ 1. (Compare Q4: BoW can be zero because it is a count vector; the source contrasts the two.) Strictly, an empty document gives zero, which is why the BoW version says "may be zero" and this one "always non-zero".
Q8. Summation of Bag-of-Words Vector (again)
a. … may be 1. b. … may be zero. c. All. d. … may be 10.
✅ Correct: c — All
A one-word document sums to 1, an empty/OOV-only one to 0, a ten-word one to 10. All three values are possible, so "all" is the only complete answer. Related: this is the same vector as Q4 — the options just enumerate the cases.
Q9. Feature Vector of Text
a. … a compressed text representation. b. … an equivalent text representation. c. … a numerical representation of the text. d. … a numerical representation that carries semantic meaning.
✅ Correct: c
One-hot/BoW vectors are numerical, not textual, and are not compression (they are usually longer than the text) and not "equivalent" (information is lost). d is the distractor: these classical vectors do not carry semantic meaning — that is the whole point of Q1.
Q10. Vocabulary and Corpus
a. Vocabulary is always smaller than corpus. b. Vocabulary is always equal to corpus. c. None. d. Vocabulary is always bigger than corpus.
✅ Correct: c — None
"Always" is what fails. Vocabulary (distinct types) ≤ corpus (tokens) for any single corpus, but you can compare a small corpus with a large vocabulary built from elsewhere, and they can be equal (a corpus of all-distinct words). So none of the absolute claims holds.
Related — the ranking to remember: corpus ⊇ documents ⊇ tokens ⊇ types/vocabulary — with types usually much fewer than tokens (Zipf's law), but never a fixed inequality across datasets.