[CS241] Asgn2 questions

Avram Levi avramlevi at lems.brown.edu
Sun Sep 23 15:57:53 EDT 2007


Justin (and everyone else)

I still have a hard time understanding some minor aspects of part d. Say 
we have the tenses A, B, C, D and we have a sequence:

A A B A C B A C B A B B A...

say we are looking for p(B|A) then to my understanding, although A 
occured in sentence 1, the first B(in sentence 3) doesn't count because 
A also occured in sentence 2 which is right before the B. On the other 
hand, the second B(in sentence 6) counts because the previous tense was 
a C - is that right?

in other words when you say "any but the previous sentence" should we 
make sure that the given tense doesn't occur in sentence j-1?

Thanks,
Avram

Justin Palmer wrote:

>Hi Lenora,
>
>Here's my take on your questions.  I might be wrong...
>
>For KL divergence, yes, order matters.  D(p || q) != D(q || p).
>That's why KL divergence is not a distance/metric.  So, I'm using the
>order Eugene asked for in the assignment, e.g, D( p(tense) || p(tense
>| tense in prev sent) ).  Regarding the log(0) issue, I ran into it
>too; my understanding is that for entropy calculations, we define 0 *
>log 0 = 0.
>
>To compute D( p(tense) || p(tense|tense in prev sent) ), I did:
>
>   KL += p(tense) * log (p(tense) / p(tense | tense in prev sent))
>
>for all tenses.  So we get 2 numbers saying how useful the two
>conditional probability distributions are as predictors of tense.
>Does that make sense?
>
>I understand part d to mean calculate p(tense | tense any but prev
>sent).  I'm computing:
>
>  P(past | past), P(future | past), etc.
>
>So if you're at sentence i, and it's past, and a past tense also
>occurred in any of the previous sentences other than the last one,
>that counts.  Also, if a future occurred in any sentence other than
>the previous sentence, add another count.  And so on.
>
>If you'd like to to compare numbers, please let me know.
>
>Also, is anyone else having problems with the Tree::newstory flag?
>Appears that it never gets set, but I'm probably missing something
>obvious.
>
>Thanks,
>
>  -- j
>_______________________________________________
>CS241 mailing list
>CS241 at list.cs.brown.edu
>http://list.cs.brown.edu/mailman/listinfo/cs241
>
>
>  
>



More information about the CS241 mailing list