LDA: make get_perplexity faster