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

Lessons

  1. 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. 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. 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

Module quiz

1. Which tags mark 'Bank of England' as one organization?
2. What is the Levenshtein distance between 'form' and 'from'?
3. What does an HMM transition probability estimate?
4. Why does the Viterbi algorithm keep back-pointers?
5. Why prefer the more frequent word among equally close spelling candidates?
6. A recognizer finds 'York' where the gold entity is 'New York'. What happens to precision and recall?

‹ Classic modelsMeaning and modern NLP ›