CS267
Chris Pollett
Aug 29, 2018
On Monday, we were talking about language modeling. Let's briefly recall some of the things we learned...
The phrase "second time" appears 20 times in Shakespeare and "second" appear 128 times.
What is `M_0(mbox("second time"))`? What is `M_1(mbox("time") | mbox("second"))`?
Post your solutions to the Aug. 29 In-Class Exercise Thread.
<DOC> <DOCNO>LA051990-0141<DOCNO> <HEADLINE>COUNCIL VOTES TO EDUCATE DOG OWNERS</HEADLINE> <P> The City Ccouncil stepped carefully around enforcement of the dog-curbing ordinance this week, vetoing the use of police to enforce the law. </P> ... </DOC>
nextPhrase(t[1],t[2], .., t[n], position) { v:=position for i = 1 to n do v:= next(t[i], v) if v == infty then // infty represents after the end of the posting list return [infty, infty] u := v for i := n-1 downto 1 do u := prev(t[i],u) if(v-u == n - 1) then return [u, v] else return nextPhrase(t[1],t[2], .., t[n], u) }