An Efficient and Effective Framework for Session-based Social Recommendation

Overview

SEFrame

This repository contains the code for the paper "An Efficient and Effective Framework for Session-based Social Recommendation".

Requirements

  • Python 3.8
  • CUDA 10.2
  • PyTorch 1.7.1
  • DGL 0.5.3
  • NumPy 1.19.2
  • Pandas 1.1.3

Usage

  1. Install all the requirements.

  2. Download the datasets:

  3. Create a folder called datasets and extract the raw data files to the folder.
    The folder should include the following files for each dataset:

    • Gowalla: loc-gowalla_totalCheckins.txt and loc-gowalla_edges.txt
    • Delicious: user_taggedbookmarks-timestamps.dat and user_contacts-timestamps.dat
    • Foursquare: dataset_WWW_Checkins_anonymized.txt and dataset_WWW_friendship_new.txt
  4. Preprocess the datasets using the Python script preprocess.py.
    For example, to preprocess the Gowalla dataset, run the following command:

    python preprocess.py --dataset gowalla

    The above command will create a folder datasets/gowalla to store the preprocessed data files.
    Replace gowalla with delicious or foursquare to preprocess other datasets.

    To see the detailed usage of preprocess.py, run the following command:

    python preprocess.py -h
  5. Train and evaluate a model using the Python script run.py.
    For example, to train and evaluate the model NARM on the Gowalla dataset, run the following command:

    python run.py --model NARM --dataset-dir datasets/gowalla

    Other available models are NextItNet, STAMP, SRGNN, SSRM, SNARM, SNextItNet, SSTAMP, SSRGNN, SSSRM, DGRec, and SERec.
    You can also see all the available models in the srs/models folder.

    To see the detailed usage of run.py, run the following command:

    python run.py -h

Dataset Format

You can train the models using your datasets. Each dataset should contain the following files:

  • stats.txt: A TSV file containing three fields, num_users, num_items, and max_len (the maximum length of sessions). The first row is the header and the second row contains the values.

  • train.txt: A TSV file containing all training sessions, where each session has three fileds, namely, sessionId, userId, and items. Both sessionId and userId should be integers. A session with a larger sessionId means that it was generated later (this requirement can be ignored if the used models do not care about the order of sessions, i.e., when the models are not DGRec). The userId should be in the range of [0, num_users). The items field of each session contains the clicked items in the session which is a sequence of item IDs separated by commas. The item IDs should be in the range of [0, num_items).

  • valid.txt and test.txt: TSV files containing all validation and test sessions, respectively. Both files have the same format as train.txt. Note that the session IDs in valid.txt and test.txt should be larger than those in train.txt.

  • edges.txt: A TSV file containing the relations in the social network. It has two columns, follower and followee. Both columns contain the user IDs.

You can see datasets/delicious for an example of the dataset.

Citation

If you use this code for your research, please cite our paper:

@inproceedings{chen2021seframe,
   title="An Efficient and Effective Framework for Session-based Social Recommendation",
   author="Tianwen {Chen} and Raymond Chi-Wing {Wong}",
   booktitle="Proceedings of the Fourteenth ACM International Conference on Web Search and Data Mining (WSDM '21)",
   pages="400--408",
   year="2021"
}
Owner
Tianwen CHEN
A CS PhD Student in HKUST
Tianwen CHEN
6002project-rl - An implemention of offline RL on recommender system

An implemention of offline RL on recommender system @author: misajie @update: 20

Tzay Lee 3 May 24, 2022
Code for KHGT model, AAAI2021

KHGT Code for KHGT accepted by AAAI2021 Please unzip the data files in Datasets/ first. To run KHGT on Yelp data, use python labcode_yelp.py For Movi

32 Nov 29, 2022
A library of metrics for evaluating recommender systems

recmetrics A python library of evalulation metrics and diagnostic tools for recommender systems. **This library is activly maintained. My goal is to c

Claire Longo 458 Jan 06, 2023
RecList is an open source library providing behavioral, "black-box" testing for recommender systems.

RecList is an open source library providing behavioral, "black-box" testing for recommender systems.

Jacopo Tagliabue 375 Dec 30, 2022
Bert4rec for news Recommendation

News-Recommendation-system-using-Bert4Rec-model Bert4rec for news Recommendation

saran pandian 2 Feb 04, 2022
Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'.

COTREC Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'. Requirements: Python 3.7, Pytorch 1.6.0 Best Hype

Xin Xia 43 Jan 04, 2023
An open source movie recommendation WebApp build by movie buffs and mathematicians that uses cosine similarity on the backend.

Movie Pundit Find your next flick by asking the (almost) all-knowing Movie Pundit Jump to Project Source » View Demo · Report Bug · Request Feature Ta

Kapil Pramod Deshmukh 8 May 28, 2022
The official implementation of "DGCN: Diversified Recommendation with Graph Convolutional Networks" (WWW '21)

DGCN This is the official implementation of our WWW'21 paper: Yu Zheng, Chen Gao, Liang Chen, Depeng Jin, Yong Li, DGCN: Diversified Recommendation wi

FIB LAB, Tsinghua University 37 Dec 18, 2022
The implementation of the submitted paper "Deep Multi-Behaviors Graph Network for Voucher Redemption Rate Prediction" in SIGKDD 2021 Applied Data Science Track.

DMBGN: Deep Multi-Behaviors Graph Networks for Voucher Redemption Rate Prediction The implementation of the accepted paper "Deep Multi-Behaviors Graph

10 Jul 12, 2022
Price-aware Recommendation with Graph Convolutional Networks,

PUP This is the official implementation of our ICDE'20 paper: Yu Zheng, Chen Gao, Xiangnan He, Yong Li, Depeng Jin, Price-aware Recommendation with Gr

S4rawBer2y 3 Oct 30, 2022
Bundle Graph Convolutional Network

Bundle Graph Convolutional Network This is our Pytorch implementation for the paper: Jianxin Chang, Chen Gao, Xiangnan He, Depeng Jin and Yong Li. Bun

55 Dec 25, 2022
Knowledge-aware Coupled Graph Neural Network for Social Recommendation

KCGN AAAI-2021 《Knowledge-aware Coupled Graph Neural Network for Social Recommendation》 Environments python 3.8 pytorch-1.6 DGL 0.5.3 (https://github.

xhc 22 Nov 18, 2022
QRec: A Python Framework for quick implementation of recommender systems (TensorFlow Based)

QRec is a Python framework for recommender systems (Supported by Python 3.7.4 and Tensorflow 1.14+) in which a number of influential and newly state-of-the-art recommendation models are implemented.

Yu 1.4k Dec 27, 2022
The source code for "Global Context Enhanced Graph Neural Network for Session-based Recommendation".

GCE-GNN Code This is the source code for SIGIR 2020 Paper: Global Context Enhanced Graph Neural Networks for Session-based Recommendation. Requirement

98 Dec 28, 2022
Learning Fair Representations for Recommendation: A Graph-based Perspective, WWW2021

FairGo WWW2021 Learning Fair Representations for Recommendation: A Graph-based Perspective As a key application of artificial intelligence, recommende

lei 39 Oct 26, 2022
基于个性化推荐的音乐播放系统

MusicPlayer 基于个性化推荐的音乐播放系统 Hi, 这是我在大四的时候做的毕设,现如今将该项目开源。 本项目是基于Python的tkinter和pygame所著。 该项目总体来说,代码比较烂(因为当时水平很菜)。 运行的话安装几个基本库就能跑,只不过里面的数据还没有上传至Github。 先

Cedric Niu 6 Nov 19, 2022
Code for my ORSUM, ACM RecSys 2020, HeroGRAPH: A Heterogeneous Graph Framework for Multi-Target Cross-Domain Recommendation

HeroGRAPH Code for my ORSUM @ RecSys 2020, HeroGRAPH: A Heterogeneous Graph Framework for Multi-Target Cross-Domain Recommendation Paper, workshop pro

Qiang Cui 9 Sep 14, 2022
Spotify API Recommnder System

This project will access your last listened songs on Spotify using its API, then it will request the user to select 5 favorite songs in that list, on which the API will proceed to make 50 recommendat

Kevin Luke 1 Dec 14, 2021
A library of Recommender Systems

A library of Recommender Systems This repository provides a summary of our research on Recommender Systems. It includes our code base on different rec

MilaGraph 980 Jan 05, 2023
Recommendation System to recommend top books from the dataset

recommendersystem Recommendation System to recommend top books from the dataset Introduction The recom.py is the main program code. The dataset is als

Vishal karur 1 Nov 15, 2021