I have been trying to implement a LDA program in python. So, far I have had little lucklittle luck. I have found this youtube video rather informative and easy to understand.
I am a programmer and I do not really understand weird mathematical notations, but here is what I collected.
- ndk = number of times in document, topic t was observed
- vkwdn = number of times in topic k, wdn was observed
- Assign topics randomly to each word in each document
- Count the number of times a word was used in a topic from all docs
- Count the number of times a document has a word of a particular topic
- Normalize the vectors in 4 and 5 for each topic
- Multiply
M1[document][topic]
withM2[topic][word]
for each topic - You should get a probability vector, having the probability for each topic
- Sample randomly using the vector as weights
- Assign it to the topic of that word in that document
- Go to step 4 unless everything has converged