Read the sentence "The dog barks loudly." You instantly know that the is a determiner, dog is a noun, barks is a verb, and loudly is an adverb. You did that in milliseconds without consciously thinking about it.
Teaching a computer to do the same thing is called part-of-speech (POS) tagging, and it is one of the oldest and most studied tasks in natural language processing. Every downstream tool â parsers, translators, search engines â builds on it.
The classic approach uses a Hidden Markov Model (HMM). The idea is elegant: the real grammatical structure of a sentence (noun follows determiner, verb follows noun, âŠ) is a hidden sequence of states. What we actually observe is just the words. The HMM encodes two kinds of knowledge as probabilities: how likely each tag is to follow the previous one (transition probabilities), and how likely each word is given a tag (emission probabilities). Finding the most likely hidden sequence for a sentence is then a problem that the Viterbi algorithm (Andrew Viterbi, 1967) solves exactly in time proportional to the length of the sentence â a beautifully efficient answer to what sounds like an exponential search.
Comments
Loading comments...