CS267
Chris Pollett
Aug 28, 2019
On Monday, we were talking about language modeling. Let's briefly recall some of the things we learned...
Suppose the phrase "hammer time" appears 2 times in Shakespeare and "hammer" appear 256 times.
What is `M_0(mbox("hammer time"))`? What is `M_1(mbox("time") | mbox("hammer"))`?
Post your solutions to the Aug. 28 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) }