Simple Python implementation of collaborative topic modeling?

前端 未结 2 847
情歌与酒
情歌与酒 2021-01-31 08:53

I came across these 2 papers which combined collaborative filtering (Matrix factorization) and Topic modelling (LDA) to recommend users similar articles/posts based on topic ter

2条回答
  •  囚心锁ツ
    2021-01-31 09:17

    This should get you started (although not sure why this hasn't been posted yet): https://github.com/arongdari/python-topic-model

    More specifically: https://github.com/arongdari/python-topic-model/blob/master/ptm/collabotm.py

    class CollaborativeTopicModel:
        """
        Wang, Chong, and David M. Blei. "Collaborative topic 
                                    modeling for recommending scientific articles."
        Proceedings of the 17th ACM SIGKDD international conference on Knowledge
                                    discovery and data mining. ACM, 2011.
        Attributes
        ----------
        n_item: int
            number of items
        n_user: int
            number of users
        R: ndarray, shape (n_user, n_item)
            user x item rating matrix
        """
    

    Looks nice and straightforward. I still suggest at least looking at gensim. Radim has done a fantastic job of optimizing that software very well.

提交回复
热议问题