Query can be considered as topic estimation of a unknown document .
by first randomly assigning topics to words and then performing a number of loops through the Gibbs sampling update, we have: where ,¬ counts the observations of word and topic in unseen document.