Closed dennishylau closed 2 years ago
Hi @dennishylau
Thank you for reporting a bug.
When you run make_doc()
, it creates a document without any topic assignment. So calling get_topics()
in this situation will not give you proper result. You need to call infer()
to estimate the distribution of topics in the doc before calling get_topics()
.
doc = hlda.make_doc(article)
hlda.infer(doc) # doc should be inferred first
doc.get_topics(top_n=10)
I'll fix crashes when calling get_topics()
or get_topic_dist()
and add a warning message to call infer
first.
Hi @bab2min, wow thank you for the prompt reply! That makes perfect sense, what a silly mistake on my end. Closing this issue now, have a nice day!
Hi, thank you for your great work!
I have been experimenting with the HLDA model, and whenever I try to get the topics of a document, my Notebook kernel crashes.
System: MacOS 10.15.7, Python 3.9.4
Code:
Stack Trace
Please let me know if there is anything else I can do to help with debugging, thank you.
Update 1:
get_topic_dist()
also crashes.