AI Hints
Home›NLP Tutorial›Review: Language Skills
NLP · Lesson 94 of 106

Review: Classic NLP

Lock in the foundations.

⏱ 2 min read▶ Video at 2:36:32🎓 Free
Watch this lesson in the NLP courseWatch on YouTube ↗Full NLP course

Before the capstone, let's make all of this stick. Testing yourself is one of the most effective ways of learning. Pause on every question, and commit to an answer.

Review: Classic NLP
From the video: Review: Classic NLP
  • Make it stick
  • Test yourself
  • Commit to an answer

Recap: classic tools

Regular expressions handle fixed formats. Edit distance measures letters. TF-IDF weights rare words. Naive Bayes multiplies word probabilities. BM25 ranks with rare words and diminishing returns. An inverted index makes search instant. And PMI finds words that belong together.

Regexfixed formats
TF-IDFrare words count
BM25ranking
Inverted indexinstant lookup

Question 1

Question 1. Which is best for finding order numbers? A, A large language model. B, A regular expression. C, Topic modelling. D, Sentiment analysis. Pause and choose. The answer is B. Fixed formats need patterns.

Quick check
Which is best for finding order numbers?

Question 2

Question 2. What's the edit distance from kitten to sitting? A, One. B, Two. C, Three. D, Seven. Pause and choose. The answer is C. Two swaps and one addition.

Quick check
What's the edit distance from kitten to sitting?

Question 3

Question 3. Why does Naive Bayes add one to its counts? A, For speed. B, So an unseen word doesn't zero everything. C, To be fair. D, For colour. Pause and choose. The answer is B. That's smoothing.

Quick check
Why does Naive Bayes add one to its counts?

Question 4

Question 4. What does an inverted index map? A, Words to documents. B, Documents to authors. C, Letters to numbers. D, Models to tokens. Pause and choose. The answer is A. Like the index in a book.

Quick check
What does an inverted index map?

Question 5

Question 5. Why does BM25 penalise long documents? A, They are slow. B, They contain more words by chance. C, They are boring. D, They cost more. Pause and choose. The answer is B. Length normalisation is built in.

Quick check
Why does BM25 penalise long documents?

Question 6

Question 6. High PMI between two words means what? A, They are both common. B, They appear together more than chance. C, They are synonyms. D, They are misspelled. Pause and choose. The answer is B. It corrects for how common each word is.

Quick check
High PMI between two words means what?

Summary

Next, the modern tools.

Key takeaways
  • Patterns for formats
  • Smoothing handles unseen words
  • PMI beats raw counts
Next up: Review: Modern NLP — embeddings, transformers, and RAG