协作主题建模的简单Python实现? [英] Simple Python implementation of collaborative topic modeling?
问题描述
我碰到了这两篇论文,它们结合了协作过滤(矩阵分解)和主题建模(LDA),根据用户感兴趣的帖子/文章的主题词向用户推荐相似的文章/帖子.
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 terms of post/articles that users are interested in.
论文(以PDF格式)为: " 用于推荐科学文章的协作主题建模 "和 " 协作推荐GitHub存储库的主题建模 "
The papers (in PDF) are: "Collaborative Topic Modeling for Recommending Scientific Articles" and "Collaborative Topic Modeling for Recommending GitHub Repositories"
新算法称为协作主题回归.我希望找到一些实现此功能的python代码,但无济于事.这可能是一个长镜头,但是有人可以显示一个简单的python示例吗?
The new algorithm is called collaborative topic regression. I was hoping to find some python code that implemented this but to no avail. This might be a long shot but can someone show a simple python example?
推荐答案
This should get you started (although not sure why this hasn't been posted yet): https://github.com/arongdari/python-topic-model
更具体地说: 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
"""
看起来很简单.我仍然建议至少查看gensim
. Radim在出色地优化该软件方面做得非常出色.
Looks nice and straightforward. I still suggest at least looking at gensim
. Radim has done a fantastic job of optimizing that software very well.
这篇关于协作主题建模的简单Python实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!