June 2018
Beginner to intermediate
306 pages
7h 42m
English
The other standard topic modeling algorithm popular in Gensim is Hierarchical Dirichlet process (HDP) - it is also a brainchild of Micheal. I. Jordan and David Blei. It is different from LDA and LSI because it is non-parametric - we don't need to mention the number of topics we need.
Again, to use it in Gensim we need to import the model from gensim.models.
hdpmodel = HdpModel(corpus=corpus, id2word=dictionary)
Note that we don't need to specify the number of topics.
hdpmodel.show_topics()
This will allow us to view the topics:
[(0, u'0.005*israeli + 0.003*arafat + 0.003*palestinian + 0.003*hit + 0.003*west_bank + 0.003*official + 0.002*sharon + 0.002*force + 0.002*afp + 0.002*arrest + 0.002*militant + 0.002*storm ...
Read now
Unlock full access