Evaluating the model

Log perplexity is a measure of how good an LDA model is. The lower the value of the perplexity, the better the model is:

print("lda_model 1- Perplexity:-",lda_model.log_perplexity(corpus_tfidf))
print("lda_model 2- Perplexity:-",lda_model2.log_perplexity(doc_term_matrix))

The output for the log perplexity is as follows: