Computational Linguistics 7, Exercise 2: two taggers disagree Code (run with py -X utf8, after the chapter's script): w = "the lamp will watch light".split() print(list(zip(w, brill(w, baseline(w))))) print(list(zip(w, viterbi(w)))) print(dict(trans["VERB"])) Output from the run: brill: the DET, lamp NOUN, will AUX, watch VERB, light NOUN viterbi: the DET, lamp NOUN, will AUX, watch VERB, light ADP VERB is followed in training by: DET 6, ADJ 2, ADP 1 (NOUN never) Why they disagree: - Brill-style: the baseline says NOUN for "light" (its most frequent tag, 3 of 5). My one rule only fires after PRON or AUX, and the previous tag here is VERB, so nothing changes. - Viterbi: the training data never has a VERB directly followed by a NOUN, so that transition only has the smoothing amount. VERB -> ADP was seen once, so it has a larger share, and it wins even though the word "light" was never seen as ADP (ADP appears only on "on"), because both factors are small and the transition gap is larger. I did not print the individual scores, so this explanation of which factor decides is my reading of the counts, not a separate check. Fix: add training sentences where a verb is directly followed by a bare noun (for example "we/PRON watch/VERB boats/NOUN", "the/DET keeper/NOUN lights/VERB lamps/NOUN"). That would give VERB -> NOUN a real count. I have not re-run with those additions.