My first backup
[dmvccm.git] / DMVCCM.html~20080527~
blobc5feba1951361db104b4d4f0d9cfa90a67a1136d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml"
4 lang="en" xml:lang="en">
5 <head>
6 <title>DMV/CCM</title>
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
8 <meta name="generator" content="Org-mode"/>
9 <meta name="generated" content="2008/05/26 15:19:21"/>
10 <meta name="author" content="Kevin Brubeck Unhammer"/>
11 <link rel="stylesheet" type="text/css" href="http://www.student.uib.no/~kun041/org.css">
12 </head><body>
13 <h1 class="title">DMV/CCM</h1>
14 <div id="table-of-contents">
15 <h2>Table of Contents</h2>
16 <div id="text-table-of-contents">
17 <ul>
18 <li><a href="#sec-1">1 dmvccm</a>
19 <ul>
20 <li><a href="#sec-1.1">1.1 [#A] P<sub>STOP</sub></a>
21 <ul>
22 <li><a href="#sec-1.1.1">1.1.1 Remember: The P<sub>STOP</sub> formula is upside-down (left-to-right also)</a></li>
23 <li><a href="#sec-1.1.2">1.1.2 How is the P<sub>STOP</sub> formula different given other values for dir and adj?</a></li>
24 </ul>
25 </li>
26 <li><a href="#sec-1.2">1.2 P<sub>CHOOSE</sub></a></li>
27 <li><a href="#sec-1.3">1.3 Initialization   </a>
28 <ul>
29 <li><a href="#sec-1.3.1">1.3.1 P<sub>STOP</sub></a></li>
30 <li><a href="#sec-1.3.2">1.3.2 P<sub>CHOOSE</sub></a></li>
31 <li><a href="#sec-1.3.3">1.3.3 CCM</a></li>
32 </ul>
33 </li>
34 <li><a href="#sec-1.4">1.4 Adjacency and combining it with inner()</a></li>
35 <li><a href="#sec-1.5">1.5 Is the E-step in DMV just inner() on the full sentence?</a></li>
36 <li><a href="#sec-1.6">1.6 What exactly is the M-step of DMV? </a></li>
37 <li><a href="#sec-1.7">1.7 Corpus access</a></li>
38 <li><a href="#sec-1.8">1.8 How do we interpret DMV as an inside/outside process?   </a></li>
39 <li><a href="#sec-1.9">1.9 Technical: sentences or rules as the "outer loop"?</a></li>
40 <li><a href="#sec-1.10">1.10 CCM-stuff</a></li>
41 <li><a href="#sec-1.11">1.11 How do we know whether we are 'adjacent' or not? </a></li>
42 </ul>
43 </li>
44 <li><a href="#sec-2">2 Python-stuff</a></li>
45 </ul>
46 </div>
47 </div>
49 <div id="outline-container-1" class="outline-2">
50 <h2 id="sec-1">1 dmvccm</h2>
51 <div id="text-1">
53 <p><span class="timestamp-kwd">DEADLINE: </span> <span class="timestamp">2008-06-30 Mon</span><br/>
54 (But absolute, extended, really-quite-dead-now deadline: August 31&hellip;)
55 <a href="src/dmv.py">dmv.py</a>
56 <a href="src/io.py">io.py</a>
57 </p>
58 </div>
60 <div id="outline-container-1.1" class="outline-3">
61 <h3 id="sec-1.1">1.1 <span class="todo">TODO</span> [#A] P<sub>STOP</sub></h3>
62 <div id="text-1.1">
64 <p><a href="src/dmv.py">dmv.py</a>
65 </p>
66 </div>
68 <div id="outline-container-1.1.1" class="outline-4">
69 <h4 id="sec-1.1.1">1.1.1 Remember: The P<sub>STOP</sub> formula is upside-down (left-to-right also)</h4>
70 <div id="text-1.1.1">
72 </div>
74 </div>
76 <div id="outline-container-1.1.2" class="outline-4">
77 <h4 id="sec-1.1.2">1.1.2 How is the P<sub>STOP</sub> formula different given other values for dir and adj?</h4>
78 <div id="text-1.1.2">
80 <p>(Presumably, the P<sub>STOP</sub> formula where STOP is True is just the
81 rule-probability of <u>h</u> -&gt; STOP h_ or h_ -&gt; h STOP, but how does
82 adjacency fit in here?)
83 </p>
84 <p>
85 (And P<sub>STOP</sub>(-STOP|&hellip;) = 1 - P<sub>STOP</sub>(STOP|&hellip;) )
86 </p></div>
87 </div>
89 </div>
91 <div id="outline-container-1.2" class="outline-3">
92 <h3 id="sec-1.2">1.2 <span class="todo">TODO</span> P<sub>CHOOSE</sub></h3>
93 <div id="text-1.2">
95 <p>Write the formulas! should be easy?
96 </p></div>
98 </div>
100 <div id="outline-container-1.3" class="outline-3">
101 <h3 id="sec-1.3">1.3 <span class="todo">TOGROK</span> Initialization   </h3>
102 <div id="text-1.3">
104 <p>we Do have to go through the corpus, since the probabilities are based
105 on how far away in the sentence arguments are from their heads.
106 </p>
108 </div>
110 <div id="outline-container-1.3.1" class="outline-4">
111 <h4 id="sec-1.3.1">1.3.1 P<sub>STOP</sub></h4>
112 <div id="text-1.3.1">
114 <p>P<sub>STOP</sub> is not well defined by K&amp;M. One possible interpretation given
115 the sentence [det nn vb nn] is
116 </p><ul>
117 <li>
118 f<sub>STOP</sub>( STOP|det, L, adj) +1
119 </li>
120 <li>
121 f<sub>STOP</sub>(-STOP|det, L, adj) +0  
122 </li>
123 <li>
124 f<sub>STOP</sub>( STOP|det, L, non<sub>adj</sub>) +1
125 </li>
126 <li>
127 f<sub>STOP</sub>(-STOP|det, L, non<sub>adj</sub>) +0
128 </li>
129 <li>
130 f<sub>STOP</sub>( STOP|det, R, adj) +0
131 </li>
132 <li>
133 f<sub>STOP</sub>(-STOP|det, R, adj) +1
135 </li>
136 <li>
137 f<sub>STOP</sub>( STOP|nn, L, adj) +0
138 </li>
139 <li>
140 f<sub>STOP</sub>(-STOP|nn, L, adj) +1
141 </li>
142 <li>
143 f<sub>STOP</sub>( STOP|nn, L, non<sub>adj</sub>) +1  # since there's at least one to the left
144 </li>
145 <li>
146 f<sub>STOP</sub>(-STOP|nn, L, non<sub>adj</sub>) +0
148 </li>
149 </ul></div>
151 </div>
153 <div id="outline-container-1.3.2" class="outline-4">
154 <h4 id="sec-1.3.2">1.3.2 P<sub>CHOOSE</sub></h4>
155 <div id="text-1.3.2">
157 <p>Go through the corpus, counting distances between heads and
158 arguments. In [det nn vb nn], we give 
159 </p><ul>
160 <li>
161 f<sub>CHOOSE</sub>(nn|det, R) +1/1 + C
162 </li>
163 <li>
164 f<sub>CHOOSE</sub>(vb|det, R) +1/2 + C
165 </li>
166 <li>
167 f<sub>CHOOSE</sub>(nn|det, R) +1/3 + C
168 <ul>
169 <li>
170 If this were the full corpus, P<sub>CHOOSE</sub>(nn|det, R) would have
171 (1+1/3+2C) / sum<sub>a</sub> f<sub>CHOOSE</sub>(a|det, R)
173 </li>
174 </ul></li>
175 </ul>
176 <p>The ROOT gets "each argument with equal probability", so in a sentence
177 of three words, 1/3 for each (in [nn vb nn], 'nn' gets 2/3). Basically
178 just a frequency count of the corpus&hellip;
179 </p></div>
181 </div>
183 <div id="outline-container-1.3.3" class="outline-4">
184 <h4 id="sec-1.3.3">1.3.3 CCM</h4>
185 <div id="text-1.3.3">
187 <p>P<sub>SPLIT</sub> used here&hellip; how, again?
188 </p></div>
189 </div>
191 </div>
193 <div id="outline-container-1.4" class="outline-3">
194 <h3 id="sec-1.4">1.4 <span class="todo">TOGROK</span> Adjacency and combining it with inner()</h3>
195 <div id="text-1.4">
197 </div>
199 </div>
201 <div id="outline-container-1.5" class="outline-3">
202 <h3 id="sec-1.5">1.5 <span class="todo">TOGROK</span> Is the E-step in DMV just inner() on the full sentence?</h3>
203 <div id="text-1.5">
205 </div>
207 </div>
209 <div id="outline-container-1.6" class="outline-3">
210 <h3 id="sec-1.6">1.6 <span class="todo">TOGROK</span> What exactly is the M-step of DMV? </h3>
211 <div id="text-1.6">
214 </div>
216 </div>
218 <div id="outline-container-1.7" class="outline-3">
219 <h3 id="sec-1.7">1.7 <span class="todo">TODO</span> Corpus access</h3>
220 <div id="text-1.7">
222 </div>
224 </div>
226 <div id="outline-container-1.8" class="outline-3">
227 <h3 id="sec-1.8">1.8 <span class="todo">TOGROK</span> How do we interpret DMV as an inside/outside process?   </h3>
228 <div id="text-1.8">
230 <p>c<sub>s</sub>(x : i, j) is "the expected fraction of parses of s" with x from
231 i to j; expectation then uses the probabilities gotten from
232 initialization and previously gained probabilities, but these are of
233 the form P<sub>STOP</sub> and P<sub>CHOOSE</sub>, how do we translate this to inside
234 outside, which just uses the probabilities of CFG-rules?
235 </p>
236 </div>
238 </div>
240 <div id="outline-container-1.9" class="outline-3">
241 <h3 id="sec-1.9">1.9 Technical: sentences or rules as the "outer loop"?</h3>
242 <div id="text-1.9">
244 </div>
246 </div>
248 <div id="outline-container-1.10" class="outline-3">
249 <h3 id="sec-1.10">1.10 CCM-stuff</h3>
250 <div id="text-1.10">
252 </div>
254 </div>
256 <div id="outline-container-1.11" class="outline-3">
257 <h3 id="sec-1.11">1.11 <span class="done">DONE</span> How do we know whether we are 'adjacent' or not? </h3>
258 <div id="text-1.11">
261 </div>
263 <div id="outline-container-1.11.0.1" class="outline-5">
264 <h5 id="sec-1.11.0.1">1.11.0.1 One configuration that I'm fairly certain of: right w/CHOOSE</h5>
265 <div id="text-1.11.0.1">
267 <p>if we have 
268 \Tree [<sub>b</sub> [<sub>b</sub> b <u>c</u> ] <u>d</u> ] 
269 then the lower tree [<sub>b</sub> b <u>c</u> ] is adjacent since, working your way up
270 the tree, no argument has been created to the right "yet"; while the
271 outer tree [<sub>b</sub> [<sub>b</sub> &hellip; ] <u>d</u> ] is non-adjacent, since there is something in
272 between&hellip; Is it thus always adjacent to the right if the distance
273 is 2? (That is, in e(s,t,i) for the adjacent rule: t - s == 2; while
274 in the non_adj rule: t - s == 4) 
275 </p><ul>
276 <li id="sec-1.11.0.1.1">Implementing this:<br/>
277 Two different DMVRules? Or just two different prob-values per rule?
278 </li>
279 </ul>
280 </div>
282 </div>
284 <div id="outline-container-1.11.0.2" class="outline-5">
285 <h5 id="sec-1.11.0.2">1.11.0.2 left w/CHOOSE</h5>
286 <div id="text-1.11.0.2">
288 <p>Same deal here?
289 </p></div>
291 </div>
293 <div id="outline-container-1.11.0.3" class="outline-5">
294 <h5 id="sec-1.11.0.3">1.11.0.3 R/L without CHOOSE, the "sealing operations"</h5>
295 <div id="text-1.11.0.3">
297 <p><u>h</u> -&gt; STOP h_ and h_ -&gt; h STOP
298 </p>
300 What is "adjacency" here? That t - s == 1?
301 </p>
305 </div>
306 </div>
307 </div>
309 </div>
311 <div id="outline-container-2" class="outline-2">
312 <h2 id="sec-2">2 Python-stuff</h2>
313 <div id="text-2">
315 <ul>
316 <li>
317 <a href="src/pseudo.py">pseudo.py</a>
318 </li>
319 <li>
320 <a href="http://nltk.org/doc/en/structured-programming.html">http://nltk.org/doc/en/structured-programming.html</a> recursive dynamic
321 </li>
322 <li>
323 <a href="http://nltk.org/doc/en/advanced-parsing.html">http://nltk.org/doc/en/advanced-parsing.html</a> 
326 </li>
327 </ul>
328 </div>
329 </div>
330 <div id="postamble"><p class="author"> Author: Kevin Brubeck Unhammer
331 <a href="mailto:K.BrubeckUnhammer at student uva nl ">&lt;K.BrubeckUnhammer at student uva nl &gt;</a>
332 </p>
333 <p class="date"> Date: 2008/05/26 15:19:21</p>
334 </div><p class="postamble">Skrive vha. emacs + <a href='http://orgmode.org/'>org-mode</a></p></body>
335 </html>