Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
courses:rg:2013:memm [2013/03/19 00:05] popel |
courses:rg:2013:memm [2013/03/27 16:56] vandemos |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Maximum Entropy Markov Models ===== | + | ===== Maximum Entropy Markov Models |
- | **1.** Explain (roughly) how the new formula for α_t+1(s) is derived (i.e. formula 1 in the paper). | + | **1. Explain (roughly) how the new formula for α_t+1(s) is derived (i.e. formula 1 in the paper).** |
+ | The formula is used for calculating the foward probabilities at each time step t, meaning it needs to use the forward probability calculated so far, the α_t(s' | ||
- | **2.** Section 2.1 states "we will split P(s|s',o) into |S| separately trained transition functions" | + | It is important to note that these two formulas are not equal. The original formula belongs to a generative joint model, whereas the new model belongs to a conditional model. |
- | **3.** Let S= {V,N} (verb and non-verb) | + | **2. Section 2.1 states "we will split P(s|s', |
+ | |||
+ | This was the bonus question since the authors of the paper do not clearly state their reasons for splitting the functions. The only advantage we came up with during the discussion was the possibility for parallelization. One main disadvantage of this splitting is mentioned in section 2.6 of the paper: the O(|S|^2) transition parameters and data sparsity. | ||
+ | |||
+ | Clearly we are not the only ones unsure about this splitting, as shown by the analysis of this very same paper by Hal and Piyush: [[http:// | ||
+ | |||
+ | **3. Let S= {V,N} (verb and non-verb) | ||
Training data = he/N can/V can/V a/N can/N | Training data = he/N can/V can/V a/N can/N | ||
// | // | ||
Line 12: | Line 19: | ||
b3 = current word is “a” and next word is “can” | b3 = current word is “a” and next word is “can” | ||
When implementing MEMM you need to define s_0, i.e. the previous state before the first token. It may be a special NULL, but for simplicity let’s define it as N. | When implementing MEMM you need to define s_0, i.e. the previous state before the first token. It may be a special NULL, but for simplicity let’s define it as N. | ||
- | a) What are the states (s) and observations (o) for this training data? | + | a) What are the states (s) and observations (o) for this training data?** |
- | b) Equation (2) defines features f_a based on // | + | States (s): {N,V} |
- | c) Equation (3) defines constraints. How many such constraints do we have? | + | Observations (o): {he, |
- | d) List all the constraints involving feature b2, i.e. substitute (whenever possible) concrete numbers into Equation (3). | + | |
- | e) In step 3 of the GIS algorithm you need to compute < | + | **b) Equation (2) defines features f_a based on // |
+ | There are three binary features and two types of states, so 6 f_a features in total. | ||
+ | |||
+ | **c) Equation (3) defines constraints. How many such constraints do we have?** | ||
+ | There are six f_a features and two types of (previous) states, so 12 constraints in total. | ||
+ | |||
+ | **d) List all the constraints involving feature b2, i.e. substitute (whenever possible) concrete numbers into Equation (3).** | ||
+ | For s'=N and a = <b2, N> | ||
+ | LHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | RHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | |||
+ | For s'=N and a = <b2, V> | ||
+ | LHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | RHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | |||
+ | For s'=V and a = <b2, N> | ||
+ | LHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | RHS: | ||
+ | (1/ | ||
+ | = 0 | ||
+ | |||
+ | For s'=V and a = <b2, V> | ||
+ | LHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | RHS: | ||
+ | (1/ | ||
+ | = (1/ | ||
+ | |||
+ | **e) In step 3 of the GIS algorithm you need to compute < | ||
+ | Since we start in iteration 0, the lambdas are all equal to 1. | ||
+ | |||
+ | P_N^{(0)}(N|can) | ||
+ | = 1/norm * exp(f_< | ||
+ | = 1/norm * exp(0 + 0 + 1 + 0 + 0 + 0) | ||
+ | |||
+ | P_N^{(0)}(V|can) | ||
+ | = 1/norm * exp(f_< | ||
+ | = 1/norm * exp(0 + 0 + 0 + 1 + 0 + 0) | ||
+ | |||
+ | norm = 2e | ||
**Hint** : You might be confused about the m_s' variable (and t_1, …, < | **Hint** : You might be confused about the m_s' variable (and t_1, …, < |