Presentation is loading. Please wait. # Three Basic Problems Compute the probability of a text: P m (W 1,N ) Compute maximum probability tag sequence: arg max T 1,N P m (T 1,N | W 1,N ) Compute.

## Presentation on theme: "Three Basic Problems Compute the probability of a text: P m (W 1,N ) Compute maximum probability tag sequence: arg max T 1,N P m (T 1,N | W 1,N ) Compute."— Presentation transcript:

Three Basic Problems Compute the probability of a text: P m (W 1,N ) Compute maximum probability tag sequence: arg max T 1,N P m (T 1,N | W 1,N ) Compute maximum likelihood model arg max m P m (W 1,N )

Notation a ij = Estimate of P(t i t j ) b jk = Estimate of P(w k | t j ) A k (i) = P(w 1,k-1, t k =t i ) (from Forward algorithm) B k (i) = P(w k+1,N | t k =t i ) (from Backwards algorithm)

EM Algorithm (Estimation-Maximization) 1.Start with some initial model 2.Compute the most likely states for each output symbol from the current model 3.Use this tagging to revise the model, increasing the probability of the most likely transitions and outputs 4.Repeat until convergence Note: No labeled training required!

Estimating transition probabilities Define p k (i,j) as prob. of traversing arc t i t j at time k given the observations: p k (i,j)= P(t k = t i, t k+1 = t j | W, m) = P(t k = t i, t k+1 = t j,W | m) / P(W | m) =

Expected transitions Define g i (k) = P(t k = t i | W, m), then: g i (k) = Now note that: –Expected number of transitions from tag i = –Expected transitions from tag i to tag j =

Reestimation a ij = = b k = =

EM Algorithm Outline 1.Choose initial model = 2.Repeat until results dont improve much: 1.Compute p t using based on current model and Forward & Backwards algorithms to compute a and b (Estimation) 2.Compute new model (Maximization) Note: Only guarantees a local maximum!

Example Tags: a, b Words: x, y, z z can only be tagged b Text: x y z z y

Some extensions for HMM POS tagging Higher-order models: P(t i 1,…,t i n tj) Incorporating text features: –Output prob = P(w i,f j | t k ) where f is a vector of features (capitalized, ends in –d, etc.) Combining labeled and unlabeled training (initialize with labeled then do EM)

Transformational Tagging Introduced by Brill (1995) Tagger: –Construct initial tag sequence for input –Iteratively refine tag sequence by applying transformation rules in rank order Learner: –Construct initial tag sequence –Loop until done: Try all possible rules, apply the best rule r* to the sequence and add it to the rule ranking

Unannotated Input Text Annotated Text Ground Truth for Input Text Rules Setting Initial State Learning Algorithm

Learning Algorithm May assign tag X to word w only if: –w occurred in the corpus with tag X, or –w did not occur in the corpus at all Try to find best transformation from some tag X to some other tag Y Greedy algorithm: Choose next the rule that maximizes accuracy on the training set

Transformation Template Change tag A to tag B when: 1.The preceding (following) tag is Z 2.The tag two before (after) is Z 3.One of the two previous (following) tags is Z 4.One of the three previous (following) tags is Z 5.The preceding tag is Z and the following is W 6.The preceding (following) tag is Z and the tag two before (after) is W

1.Initial tag annotation 2.while transformations can be found, do: a.for each from_tag, do: for each to_tag, do: for pos 1 to corpus_size, do: if (correct_tag(pos) = to_tag && tag(pos) = from_tag) then num_good_trans(tag(pos – 1))++ else if (correct_tag(pos) = from_tag && tag(pos) = from_tag) then num_bad_trans(tag(pos – 1))++ find max T (num_good_trans(T) – num_bad_trans(T)) if this is the best score so far, store as best rule: Change from_tag to to_tag if previous tag is T b.Apply best rule to training corpus c.Append best rule to ordered list of transformations

Some examples 1. Change NN to VB if previous is TO –to/TO conflict/NN with VB 2. Change VBP to VB if MD in previous three –might/MD vanish/VBP VB 3. Change NN to VB if MD in previous two –might/MD reply/NN VB 4. Change VB to NN if DT in previous two –might/MD the/DT reply/VB NN

Lexicalization New templates to include dependency on surrounding words (not just tags): Change tag A to tag B when: 1.The preceding (following) word is w 2.The word two before (after) is w 3.One of the two preceding (following) words is w 4.The current word is w 5.The current word is w and the preceding (following) word is v 6.The current word is w and the preceding (following) tag is X 7.etc…

Initializing Unseen Words How to choose most likely tag for unseen words? Transformation based approach: –Start with NP for capitalized words, NN for others –Learn transformations from: Change tag from X to Y if: 1.Deleting prefix (suffix) x results in a known word 2.The first (last) characters of the word are x 3.Adding x as a prefix (suffix) results in a known word 4.Word W ever appears immediately before (after) the word 5.Character Z appears in the word

Morphological Richness Parts of speech really include features: –NN2 Noun(type=common,num=plural) This is more visible in other languages with richer morphology: –Hebrew nouns: number, gender, possession –German nouns: number, gender, case, ??? –And so on…

Download ppt "Three Basic Problems Compute the probability of a text: P m (W 1,N ) Compute maximum probability tag sequence: arg max T 1,N P m (T 1,N | W 1,N ) Compute."

Similar presentations

Ads by Google