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"
}
You might also like...
Plex-recommender - Get movie recommendations based on your current PleX library

plex-recommender Description: Get movie/tv recommendations based on your current

Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk

Annoy Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python bindings to search for points in space that are close to a given quer

A Python scikit for building and analyzing recommender systems

Overview Surprise is a Python scikit for building and analyzing recommender systems that deal with explicit rating data. Surprise was designed with th

E-Commerce recommender demo with real-time data and a graph database
E-Commerce recommender demo with real-time data and a graph database

🔍 E-Commerce recommender demo 🔍 This is a simple stream setup that uses Memgraph to ingest real-time data from a simulated online store. Data is str

Official repository for "Exploiting Session Information in BERT-based Session-aware Sequential Recommendation", SIGIR 2022 short.

Session-aware BERT4Rec Official repository for "Exploiting Session Information in BERT-based Session-aware Sequential Recommendation", SIGIR 2022 shor

[SIGIR22] Official PyTorch implementation for
[SIGIR22] Official PyTorch implementation for "CORE: Simple and Effective Session-based Recommendation within Consistent Representation Space".

CORE This is the official PyTorch implementation for the paper: Yupeng Hou, Binbin Hu, Zhiqiang Zhang, Wayne Xin Zhao. CORE: Simple and Effective Sess

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

FastAPI Server Session is a dependency-based extension for FastAPI that adds support for server-sided session management

FastAPI Server-sided Session FastAPI Server Session is a dependency-based extension for FastAPI that adds support for server-sided session management.

ANKIT-OS/TG-SESSION-HACK-BOT: A Special Repository.Telegram Bot Which Can Hack The Victim By Using That Victim Session
ANKIT-OS/TG-SESSION-HACK-BOT: A Special Repository.Telegram Bot Which Can Hack The Victim By Using That Victim Session

🔰 ᵀᴱᴸᴱᴳᴿᴬᴹ ᴴᴬᶜᴷ ᴮᴼᵀ 🔰 The owner would not be responsible for any kind of bans due to the bot. • ⚡ INSTALLING ⚡ • • 🛠️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs 🔰 • If

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

Official public repository of paper
Official public repository of paper "Intention Adaptive Graph Neural Network for Category-Aware Session-Based Recommendation"

Intention Adaptive Graph Neural Network (IAGNN) This is the official repository of paper Intention Adaptive Graph Neural Network for Category-Aware Se

Session-based Recommendation, CoHHN, price preferences, interest preferences, Heterogeneous Hypergraph, Co-guided Learning, SIGIR2022

This is our implementation for the paper: Price DOES Matter! Modeling Price and Interest Preferences in Session-based Recommendation Xiaokun Zhang, Bo

Product-based-recommendation-system - A product based recommendation system which uses Machine learning algorithm such as KNN and cosine similarity Elliot is a comprehensive recommendation framework that analyzes the recommendation problem from the researcher's perspective.
Elliot is a comprehensive recommendation framework that analyzes the recommendation problem from the researcher's perspective.

Comprehensive and Rigorous Framework for Reproducible Recommender Systems Evaluation

An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow implementation of SERank model. The code is developed based on TF-Ranking.
An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow implementation of SERank model. The code is developed based on TF-Ranking.

SERank An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow

ViDT: An Efficient and Effective Fully Transformer-based Object Detector
ViDT: An Efficient and Effective Fully Transformer-based Object Detector

ViDT: An Efficient and Effective Fully Transformer-based Object Detector by Hwanjun Song1, Deqing Sun2, Sanghyuk Chun1, Varun Jampani2, Dongyoon Han1,

🔎 Hunt down social media accounts by username across social networks
🔎 Hunt down social media accounts by username across social networks

Hunt down social media accounts by username across social networks Installation | Usage | Docker Notes | Contributing Installation # clone the repo $

Abilian Social Business Engine - an enterprise social networking / collaboration platform.
Abilian Social Business Engine - an enterprise social networking / collaboration platform.

About Abilian SBE (Social Business Engine) is a platform for social business applications, and more specifically collaborative / enterprise 2.0 busine

Comments
  • The improvement of social information is not signifcant

    The improvement of social information is not signifcant

    As in paper, SSR-GNN(a session-based model neglecting social information ) 's performace as: 45.46 24.97 52.95 25.49 39.92 21.10 49.35 21.81 61.04 33.47 69.50 34.06 while the performace of proposed SERc is: 46.01 25.14 53.72 25.67 40.02 21.29 49.53 21.98 61.66 34.03 70.05 34.62 Does this means social information is not important or not well employed?

    opened by Snnzhao 2
Owner
Tianwen CHEN
A CS PhD Student in HKUST
Tianwen CHEN
ToR[e]cSys is a PyTorch Framework to implement recommendation system algorithms

ToR[e]cSys is a PyTorch Framework to implement recommendation system algorithms, including but not limited to click-through-rate (CTR) prediction, learning-to-ranking (LTR), and Matrix/Tensor Embedding. The project objective is to develop a ecosystem to experiment, share, reproduce, and deploy in real world in a smooth and easy way (Hope it can be done).

LI, Wai Yin 90 Oct 8, 2022
A framework for large scale recommendation algorithms.

A framework for large scale recommendation algorithms.

Alibaba Group - PAI 880 Jan 3, 2023
Implementation of a hadoop based movie recommendation system

Implementation-of-a-hadoop-based-movie-recommendation-system 通过编写代码,设计一个基于Hadoop的电影推荐系统,通过此推荐系统的编写,掌握在Hadoop平台上的文件操作,数据处理的技能。windows 10 hadoop 2.8.3 p

汝聪(Ricardo) 5 Oct 2, 2022
Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems.

Persine, the Persona Engine Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems. It has a simple interface a

Jonathan Soma 87 Nov 29, 2022
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
A Python implementation of LightFM, a hybrid recommendation algorithm.

LightFM Build status Linux OSX (OpenMP disabled) Windows (OpenMP disabled) LightFM is a Python implementation of a number of popular recommendation al

Lyst 4.2k Jan 2, 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
Books Recommendation With Python

Books-Recommendation Business Problem During the last few decades, with the rise

Çağrı Karadeniz 7 Mar 12, 2022
Bert4rec for news Recommendation

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

saran pandian 2 Feb 4, 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. QRec has a lightweight architecture and provides user-friendly interfaces. It can facilitate model implementation and evaluation.

Yu 1.4k Dec 27, 2022