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">
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">
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">
18 <li><a href="#sec-1">1 dmvccm</a>
20 <li><a href="#sec-1.1">1.1 [#A] P<sub>STOP</sub></a>
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>
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>
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>
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>
44 <li><a href="#sec-2">2 Python-stuff</a></li>
49 <div id="outline-container-1" class="outline-2">
50 <h2 id="sec-1">1 dmvccm</h2>
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…)
55 <a href="src/dmv.py">dmv.py</a>
56 <a href="src/io.py">io.py</a>
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>
64 <p><a href="src/dmv.py">dmv.py</a>
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>
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>
80 <p>(Presumably, the P<sub>STOP</sub> formula where STOP is True is just the
81 rule-probability of <u>h</u> -> STOP h_ or h_ -> h STOP, but how does
82 adjacency fit in here?)
85 (And P<sub>STOP</sub>(-STOP|…) = 1 - P<sub>STOP</sub>(STOP|…) )
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>
95 <p>Write the formulas! should be easy?
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>
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.
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&M. One possible interpretation given
115 the sentence [det nn vb nn] is
118 f<sub>STOP</sub>( STOP|det, L, adj) +1
121 f<sub>STOP</sub>(-STOP|det, L, adj) +0
124 f<sub>STOP</sub>( STOP|det, L, non<sub>adj</sub>) +1
127 f<sub>STOP</sub>(-STOP|det, L, non<sub>adj</sub>) +0
130 f<sub>STOP</sub>( STOP|det, R, adj) +0
133 f<sub>STOP</sub>(-STOP|det, R, adj) +1
137 f<sub>STOP</sub>( STOP|nn, L, adj) +0
140 f<sub>STOP</sub>(-STOP|nn, L, adj) +1
143 f<sub>STOP</sub>( STOP|nn, L, non<sub>adj</sub>) +1 # since there's at least one to the left
146 f<sub>STOP</sub>(-STOP|nn, L, non<sub>adj</sub>) +0
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
161 f<sub>CHOOSE</sub>(nn|det, R) +1/1 + C
164 f<sub>CHOOSE</sub>(vb|det, R) +1/2 + C
167 f<sub>CHOOSE</sub>(nn|det, R) +1/3 + C
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)
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…
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… how, again?
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>
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>
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>
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>
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>
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?
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>
248 <div id="outline-container-1.10" class="outline-3">
249 <h3 id="sec-1.10">1.10 CCM-stuff</h3>
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>
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">
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> … ] <u>d</u> ] is non-adjacent, since there is something in
272 between… 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)
276 <li id="sec-1.11.0.1.1">Implementing this:<br/>
277 Two different DMVRules? Or just two different prob-values per rule?
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">
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> -> STOP h_ and h_ -> h STOP
300 What is "adjacency" here? That t - s == 1?
311 <div id="outline-container-2" class="outline-2">
312 <h2 id="sec-2">2 Python-stuff</h2>
317 <a href="src/pseudo.py">pseudo.py</a>
320 <a href="http://nltk.org/doc/en/structured-programming.html">http://nltk.org/doc/en/structured-programming.html</a> recursive dynamic
323 <a href="http://nltk.org/doc/en/advanced-parsing.html">http://nltk.org/doc/en/advanced-parsing.html</a>
330 <div id="postamble"><p class="author"> Author: Kevin Brubeck Unhammer
331 <a href="mailto:K.BrubeckUnhammer at student uva nl "><K.BrubeckUnhammer at student uva nl ></a>
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>