Structure in text
Part-of-speech tagging with hidden Markov models and the Viterbi algorithm, named entities with BIO tags and chunking, and edit distance for spelling correction.
About 5 hours of study
Learning objectives
- Estimate an HMM and decode it with Viterbi
- Encode, find and evaluate named entities
- Compute edit distances and correct spelling
Lessons
- 1
Part-of-speech tagging with an HMM Intermediate
Label each word as a noun, verb, determiner and so on. Start from a most-frequent-tag baseline, estimate a hidden Markov model's transition and emission probabilities from a tagged corpus, and find the best tag sequence with the Viterbi algorithm.
- 2
Named entities and chunking Intermediate
Find the people, places, organizations and dates in text, encode them with BIO tags, read spans back out of tag sequences, chunk noun phrases from part-of-speech patterns, and score a recognizer at the entity level.
- 3
Edit distance and spelling correction Intermediate
Measure how far apart two strings are with Levenshtein edit distance, computed by dynamic programming; add adjacent swaps for typing errors; and build a spelling corrector that picks the most frequent dictionary word within a small distance.
Module practice
- NLP: A most-frequent-tag baselineEasy
- NLP: Estimate HMM probabilitiesMedium
- NLP: Tag a sentence with ViterbiHard
- NLP: Read entities from BIO tagsEasy
- NLP: Chunk noun phrasesMedium
- NLP: Score an entity recognizerHard
- NLP: One edit apart?Easy
- NLP: Edit distance with custom costsMedium
- NLP: A frequency-based spelling correctorHard