All Projects → ShomyLiu → Neu Review Rec

ShomyLiu / Neu Review Rec

A Toolkit for Neural Review-based Recommendation models with Pytorch.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Neu Review Rec

Cornac
A Comparative Framework for Multimodal Recommender Systems
Stars: ✭ 308 (+234.78%)
Mutual labels:  recommendation-system
Recbole
A unified, comprehensive and efficient recommendation library
Stars: ✭ 780 (+747.83%)
Mutual labels:  recommendation-system
Movie
Personalized real-time movie recommendation system
Stars: ✭ 37 (-59.78%)
Mutual labels:  recommendation-system
Reco Gym
Code for reco-gym: A Reinforcement Learning Environment for the problem of Product Recommendation in Online Advertising
Stars: ✭ 314 (+241.3%)
Mutual labels:  recommendation-system
Openrec
OpenRec is an open-source and modular library for neural network-inspired recommendation algorithms
Stars: ✭ 360 (+291.3%)
Mutual labels:  recommendation-system
Deeprec
推荐、广告工业界经典以及最前沿的论文、资料集合/ Must-read Papers on Recommendation System and CTR Prediction
Stars: ✭ 822 (+793.48%)
Mutual labels:  recommendation-system
Recommend
recommendation system with python
Stars: ✭ 284 (+208.7%)
Mutual labels:  recommendation-system
Movie Recommender System
Basic Movie Recommendation Web Application using user-item collaborative filtering.
Stars: ✭ 85 (-7.61%)
Mutual labels:  recommendation-system
Deep Recommender System
深度学习在推荐系统中的应用及论文小结。
Stars: ✭ 657 (+614.13%)
Mutual labels:  recommendation-system
Drugs Recommendation Using Reviews
Analyzing the Drugs Descriptions, conditions, reviews and then recommending it using Deep Learning Models, for each Health Condition of a Patient.
Stars: ✭ 35 (-61.96%)
Mutual labels:  recommendation-system
Caserecommender
Case Recommender: A Flexible and Extensible Python Framework for Recommender Systems
Stars: ✭ 318 (+245.65%)
Mutual labels:  recommendation-system
Recnn
Reinforced Recommendation toolkit built around pytorch 1.7
Stars: ✭ 362 (+293.48%)
Mutual labels:  recommendation-system
Recommendation System Practice Notes
《推荐系统实践》代码与读书笔记,在线阅读地址:https://relph1119.github.io/recommendation-system-practice-notes
Stars: ✭ 22 (-76.09%)
Mutual labels:  recommendation-system
Recsys
项亮的《推荐系统实践》的代码实现
Stars: ✭ 306 (+232.61%)
Mutual labels:  recommendation-system
Kdd Multimodalities Recall
This is our solution for KDD Cup 2020. We implemented a very neat and simple neural ranking model based on siamese BERT which ranked first among the solo teams and ranked 12th among all teams on the final leaderboard.
Stars: ✭ 61 (-33.7%)
Mutual labels:  recommendation-system
Recdb Postgresql
RecDB is a recommendation engine built entirely inside PostgreSQL
Stars: ✭ 297 (+222.83%)
Mutual labels:  recommendation-system
Recsys2019 deeplearning evaluation
This is the repository of our article published in RecSys 2019 "Are We Really Making Much Progress? A Worrying Analysis of Recent Neural Recommendation Approaches" and of several follow-up studies.
Stars: ✭ 780 (+747.83%)
Mutual labels:  recommendation-system
Toptal Recommengine
Prototype recommendation engine built to accompany an article on Toptal Blog
Stars: ✭ 90 (-2.17%)
Mutual labels:  recommendation-system
Tensorrec
A TensorFlow recommendation algorithm and framework in Python.
Stars: ✭ 1,130 (+1128.26%)
Mutual labels:  recommendation-system
Deeprec
An Open-source Toolkit for Deep Learning based Recommendation with Tensorflow.
Stars: ✭ 954 (+936.96%)
Mutual labels:  recommendation-system

A Toolkit for Neural Review-based Recommendation models with Pytorch. 基于评论文本的深度推荐系统模型库 (Pytorch)

Neural Review-based Recommendaton

In this repository, we reimplement some important review-based recommendation models, and provide an extensible framework NRRec with Pytorch. Researchers can implement their own methodss easily in our framework (just in models folder).

Introduction to Review-based Recommendaiton

E-commerce platforms allow users to post their reviews towards products, and the reviews may contain the opinions of users and the features of the items. Hence, many works start to utilize the reviews to model user preference and item features. Traditional methods always use topic modelling technology to capture the semantic informtion. Recently, many deep learning based methods are proposed, such as DeepCoNN, D-Attn etc, which use the neural networks, attention mechanism to learn representations of users and items more comprehensively.

More details please refer to my blog.

Methods

Note: since each user and each item would have multiple reviews, we categorize the existing methods into two kinds:

  • document-level methods: concatenate all the reviews into a long document, and then learn representations from the doc, we denote as Doc feature.
  • review-level methods: model each review seperately and then aggregate all reviews together as the user item latent feature.

Besides, the rating feature of users and items (i.e., ID embedding) is usefule when there are few reviews. So there would be three features in all (i.e., document-level, review-level, ID).

We plan to follow the state-of-art review-based recommendation methods and involve them into this repo, the baseline methods are listed here:

Method Feature Status
DeepCoNN(WSDM'17) Doc
D-Attn(RecSys'17) Doc
ANR(CIKM'18) Doc, ID
NARRE(WWW'18) Review, ID
MPCN(KDD'18) Review
TARMF(WWW'18) Review, ID
CARL(TOIS'19) Doc, ID
CARP(SIGIR'19) Doc, ID
DAML(KDD'19) Doc, ID

We will release the rest unfinished baseline methods later.

References

  • Zheng L, Noroozi V, Yu P S. Joint deep modeling of users and items using reviews for recommendation[C]//Proceedings of the Tenth ACM International Conference on Web Search and Data Mining. ACM, 2017: 425-434.
  • Sungyong Seo, Jing Huang, Hao Yang, and Yan Liu. 2017. Interpretable Convolutional Neural Networks with Dual Local and Global Attention for Review Rating Prediction. In Proceedings ofthe Eleventh ACMConference on Recommender Systems.
  • Chin J Y, Zhao K, Joty S, et al. ANR: Aspect-based neural recommender[C]//Proceedings of the 27th ACM International Conference on Information and Knowledge Management. 2018: 147-156.
  • Chen C, Zhang M, Liu Y, et al. Neural attentional rating regression with review-level explanations[C]//Proceedings of the 2018 World Wide Web Conference. 2018: 1583-1592.
  • Tay Y, Luu A T, Hui S C. Multi-pointer co-attention networks for recommendation[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2018: 2309-2318.
  • Lu Y, Dong R, Smyth B. Coevolutionary recommendation model: Mutual learning between ratings and reviews[C]//Proceedings of the 2018 World Wide Web Conference. 2018: 773-782.
  • Wu L, Quan C, Li C, et al. A context-aware user-item representation learning for item recommendation[J]. ACM Transactions on Information Systems (TOIS), 2019, 37(2): 1-29.
  • Li C, Quan C, Peng L, et al. A capsule network for recommendation and explaining what you like and dislike[C]//Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval. 2019: 275-284.
  • Liu D, Li J, Du B, et al. Daml: Dual attention mutual learning between ratings and reviews for item recommendation[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2019: 344-352.

Usage

Requirements

  • Python >= 3.6
  • Pytorch >= 1.0
  • fire: commend line parameters (in config/config.py)
  • numpy, gensim etc.

Use the code

  • Preprocessing the origin Amazon or Yelp dataset via pro_data/data_pro.py, then some npy files will be generated in dataset/, including train, val, and test datset.
    cd pro_data
    python3 data_pro.py Digital_Music_5.json
    # details in data_pro.py (e.g., the pretrained word2vec.bin path)
    
  • Train the model. Take DeepCoNN and NARRE as examples, the command lines can be customized:
    python3 main.py train --model=DeepCoNN --num_fea=1 --output=fm
    python3 main.py train --model=NARRE --num_fea=2 --output=lfm
    
    Note that the num_fea (1,2,3) corresponds how many features used in the methods, (ID feature, Review-level and Doc-level denoted above).
  • Test the model using the saved pth file in checkpoints in the test datase: for example:
    python3 main.py test --pth_path="./checkpoints/THE_PTH_PATH" --model=DeepCoNN
    
    

An output sample:

loading train data
loading val data
train data: 51764; test data: 6471
start training....
2020-07-28 12:27:58  Epoch 0...
        train data: loss:107503.6215, mse: 2.0768;
        evaluation reslut: mse: 1.2466; rmse: 1.1165; mae: 0.9691;
model save
******************************
2020-07-28 12:28:13  Epoch 1...
        train data: loss:80552.2573, mse: 1.5561;
        evaluation reslut: mse: 1.0296; rmse: 1.0147; mae: 0.8384;
model save
******************************
2020-07-28 12:28:29  Epoch 2...
        train data: loss:70202.6199, mse: 1.3562;
        evaluation reslut: mse: 0.9926; rmse: 0.9963; mae: 0.8146;
model save
******************************

Framework Design

An overview of the package dir: framework

Data Preprocessing

After data processing, one record of the training/validation/test dataset is:

user_id, item_id, ratings

For example the training data triples are stored as Train.npy, Train_Score.npy in dataset/Digital_Music_data/train/.

The review information of users and items are preprocessed in the following format:

  • user_id
  • user_doc: the word index sequence of the document of the user, [w1, w2, ... wn]
  • user_reviews list: the list of all the review of the user, [[w1,w2..], [w1,w2,..],...[w1,w2..]]
  • user_item2id: the item ids that the user have purchased, [id1, id2,...]

The same as the items. Hence in the code, we orgnize our batch data as:

uids, iids, user_reviews, item_reviews, user_item2id, item_user2id, user_doc, item_doc

This is all the information involved in review-based recommendation, researchers can utilize this data format to build own models. Note that the review in validation/test dataset is excluded.

Note that the review processing methods are usually different among these papers (e.g., the vocab, padding), which would influence their performance. In this repo, to be fair, we adopt the same pre-poressing approach for all the methods. Hence the performance may be not consistent with the origin papers.

Model Details

In order to make our framework more extensible, we define three modules in our framework:

  • User/Item Representation Learning Layer (in models/*py): the main part of most baseline methods, such as the CNN encoder in DeepCoNN.
  • Fusion Layer in framework/fusion.py: combine the user/item different features (e.g., ID feature and review/doc feature), and then fuse the user and item feature into one feature vector, we pre-define the following methods:
    • sum
    • add
    • concatenation
    • self attention
  • Prediction Layer in framework/prediction.py: prediction the score that user towards item (i.e., a regression layer), we pre-define the following rating prediction layers:
    • (Neural) Factorization Machine
    • Latent Factor Model
    • MLP

Hence, researchers could build their models in user/item representation learning layer.

Note that if you would like to add new method or datset, please remember to declare in the __init__.py

Citation

If you use the code, please cite:

@inproceedings{liu2019nrpa,
  title={NRPA: Neural Recommendation with Personalized Attention},
  author={Liu, Hongtao and Wu, Fangzhao and Wang, Wenjun and Wang, Xianchen and Jiao, Pengfei and Wu, Chuhan and Xie, Xing},
  booktitle={Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval},
  pages={1233--1236},
  year={2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].