xiaohuiyan / BTM

Code for Biterm Topic Model (published in WWW 2013)
https://github.com/xiaohuiyan/xiaohuiyan.github.io/blob/master/paper/BTM-WWW13.pdf
Apache License 2.0
405 stars 137 forks source link

compute_pz_b #23

Open markoarnauto opened 5 years ago

markoarnauto commented 5 years ago

First of all, thanks for providing such a great library! The code really helps to understand the paper. But I am still wondering why the topic probability distribution P(z|B) for the oBTM seems different from the paper?

The paper states that: bildschirmfoto 2018-12-03 um 14 20 41

But the actual calculation goes:

pw1k = (nwz[k][w1] + beta[k][w1]) / (2 * nb_z[k] + beta_sum[k]);
pw2k = (nwz[k][w2] + beta[k][w2]) / (2 * nb_z[k] + 1 + beta_sum[k]);
pz[k] = (nb_z[k] + alpha[k]) * pw1k * pw2k;

What did I miss?

sebinsuresh commented 4 years ago

Did you ever figure this issue out?