Created
August 26, 2020 11:05
-
-
Save FeryET/e44c3ffb93f195a7524aea5307e29225 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdp_model = HDPModel(min_df=min_df, rm_top=rm_top) | |
hdp_model.optim_interval = 5 | |
for d in docs_train: | |
hdp_model.add_doc(d) | |
hdp_model.burn_in = 100 | |
hdp_model.train(0, workers=workers) | |
for i in range(0, 1000, 10): | |
hdp_model.train(10, workers=workers) | |
print('Iteration: {}\tLog-likelihood: {}\tNum. of topics: {}'.format(i, hdp_model.ll_per_word, hdp_model.live_k)) | |
num_of_topics = hdp_model.live_k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment