 Sequence labeling: There is a somewhat arbitrary line between the preceding task and sequence labeling. For example, it is quite possible to treat POS tagging as a task of classifying words in a text in relation to their context.  However, such an approach fails to exploit the fact that the classifications of adjacent words are interdependent. For example, in the sentence (from the web)  “I don't fish like most people”, the occurrence of don't should favor classification of fish as a verb, which in turn should favor classification of like as a preposition. (At least such preferences make sense for declarative sentences; replacing ‘I’ by ‘why’ would change matters—see below.) Such cascaded influences are not easily captured through successive independent classifications, and they motivate generative sequence models such as HMMs. For POS tagging, a labeled training corpus can supply estimates of the probability of any POS for the next word, given the POS of the current word. If the corpus is large enough, it can also supply estimates of word “emission” probabilities for a large proportion of words generally seen in text, i.e., their probability of occurring, given the POS label. (Smoothing techniques are used to fill in non-zero probabilities for unknown words, given a POS.) We previously mentioned the Viterbi algorithm as an efficient dynamic programming algorithm for applying an HMM (trained as just mentioned) to the task of assigning a maximum-probability POS tag sequence to the words of a text.  Two related algorithms, the forward and backward algorithms, can be used to derive probabilities of the possible labels at each word position i, which may be more useful than the “best” label sequence for subsequent higher-level processing. The forward algorithm in effect (via dynamic programming) sums the probabilities of all label sequences up to position i that end with a specified label X at word position i and that generate the input up to (and including) that word. The backward algorithm sums the probabilities of all label sequences that begin with label X at position i, and generate the input from position i+1 to the end.  The product of the forward and backward probabilities, normalized so that the probabilities of the alternative labels at position i sum to 1, give the probability of X at i, conditioned on the entire input.