Skip to content

Instantly share code, notes, and snippets.

@FeryET
Created August 26, 2020 11:05
Show Gist options
  • Save FeryET/e44c3ffb93f195a7524aea5307e29225 to your computer and use it in GitHub Desktop.
Save FeryET/e44c3ffb93f195a7524aea5307e29225 to your computer and use it in GitHub Desktop.
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