• This repository has been archived on 12/Nov/2021
  • Stars
    star
    817
  • Rank 55,377 (Top 2 %)
  • Language
    Python
  • Created almost 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[AAAI 2019] Source code and datasets for "Session-based Recommendation with Graph Neural Networks"

SR-GNN

Paper data and code

This is the code for the AAAI 2019 Paper: Session-based Recommendation with Graph Neural Networks. We have implemented our methods in both Tensorflow and Pytorch.

Here are two datasets we used in our paper. After downloaded the datasets, you can put them in the folder datasets/:

There is a small dataset sample included in the folder datasets/, which can be used to test the correctness of the code.

We have also written a blog explaining the paper.

Usage

You need to run the file datasets/preprocess.py first to preprocess the data.

For example: cd datasets; python preprocess.py --dataset=sample

usage: preprocess.py [-h] [--dataset DATASET]

optional arguments:
  -h, --help         show this help message and exit
  --dataset DATASET  dataset name: diginetica/yoochoose/sample

Then you can run the file pytorch_code/main.py or tensorflow_code/main.py to train the model.

For example: cd pytorch_code; python main.py --dataset=sample

You can add the suffix --nonhybrid to use the global preference of a session graph to recommend instead of the hybrid preference.

You can also change other parameters according to the usage:

usage: main.py [-h] [--dataset DATASET] [--batchSize BATCHSIZE]
               [--hiddenSize HIDDENSIZE] [--epoch EPOCH] [--lr LR]
               [--lr_dc LR_DC] [--lr_dc_step LR_DC_STEP] [--l2 L2]
               [--step STEP] [--patience PATIENCE] [--nonhybrid]
               [--validation] [--valid_portion VALID_PORTION]

optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET     dataset name:
                        diginetica/yoochoose1_4/yoochoose1_64/sample
  --batchSize BATCHSIZE
                        input batch size
  --hiddenSize HIDDENSIZE
                        hidden state size
  --epoch EPOCH         the number of epochs to train for
  --lr LR               learning rate
  --lr_dc LR_DC         learning rate decay rate
  --lr_dc_step LR_DC_STEP
                        the number of epochs after which the learning rate
                        decay
  --l2 L2               l2 penalty
  --step STEP           gnn propogation steps
  --patience PATIENCE   the number of epoch to wait before early stop
  --nonhybrid           only use the global preference to predict
  --validation          validation
  --valid_portion VALID_PORTION
                        split the portion of training set as validation set

Requirements

  • Python 3
  • PyTorch 0.4.0 or Tensorflow 1.9.0

Other Implementation for Reference

There are other implementation available for reference:

  • Implementation based on PaddlePaddle by Baidu [Link]
  • Implementation based on PyTorch Geometric [Link]
  • Another implementation based on Tensorflow [Link]
  • Yet another implementation based on Tensorflow [Link]

Citation

Please cite our paper if you use the code:

@inproceedings{Wu:2019ke,
title = {{Session-based Recommendation with Graph Neural Networks}},
author = {Wu, Shu and Tang, Yuyuan and Zhu, Yanqiao and Wang, Liang and Xie, Xing and Tan, Tieniu},
year = 2019,
booktitle = {Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence},
location = {Honolulu, HI, USA},
month = jul,
volume = 33,
number = 1,
series = {AAAI '19},
pages = {346--353},
url = {https://aaai.org/ojs/index.php/AAAI/article/view/3804},
doi = {10.1609/aaai.v33i01.3301346},
editor = {Pascal Van Hentenryck and Zhi-Hua Zhou},
}

More Repositories

1

GRACE

[GRL+ @ ICML 2020] PyTorch implementation for "Deep Graph Contrastive Representation Learning" (https://arxiv.org/abs/2006.04131v2)
Python
278
star
2

TextING

[ACL 2020] Tensorflow implementation for "Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks"
Python
176
star
3

GCA

[WWW 2021] Source code for "Graph Contrastive Learning with Adaptive Augmentation"
Python
146
star
4

H-GCN

[IJCAI 2019] Source code and datasets for "Hierarchical Graph Convolutional Networks for Semi-supervised Node Classification"
Python
114
star
5

NGNN

[WWW 2019] Code and dataset for "Dressing as a Whole: Outfit Compatibility Learning Based on Node-wise Graph Neural Networks"
Python
81
star
6

Fi_GNN

[CIKM 2019] Code and dataset for "Fi-GNN: Modeling Feature Interactions via Graph Neural Networks for CTR Prediction"
80
star
7

A-PGNN

[TKDE 2021] Source code and datasets for the paper "Personalizing Graph Neural Networks with Attention Mechanism for Session-based Recommendation"
Python
80
star
8

GraphCTR

This repo includes some graph-based CTR prediction models and other representative baselines.
Python
64
star
9

DGSR

[TKDE 2022] The source code of "Dynamic Graph Neural Networks for Sequential Recommendation"
Python
62
star
10

TAGNN

[SIGIR 2020] Python implementation for "TAGNN: Target Attentive Graph Neural Networks for Session-based Recommendation"
Python
50
star
11

GET

[WWW 2022] The source code of "Evidence-aware Fake News Detection with Graph Neural Networks"
Python
43
star
12

DGCF

[ICDM 2020] Python implementation for "Dynamic Graph Collaborative Filtering."
Python
42
star
13

LATTICE

[ACMMM 2021] PyTorch implementation for "Mining Latent Structures for Multimedia Recommendation"
Python
34
star
14

DyGCN

Code for "DyGCN: Dynamic Graph Embedding with Graph Convolutional Network"
Python
33
star
15

HGLS

[WWW 2023] The source code of "Learning Long- and Short-term Representations for Temporal Knowledge Graph Reasoning"
Python
23
star
16

MICRO

Python
22
star
17

GETRAL

The source code of "Adversarial Contrastive Learning for Evidence-aware Fake News Detection with Graph Neural Networks
Python
18
star
18

LogicCheckGPT

[ACL 2024] Logical Closed Loop: Uncovering Object Hallucinations in Large Vision-Language Models. Detect and mitigate object hallucinations in LVLMs by itself through logical closed loops.
Python
15
star
19

GraphAIR

[PR 2021] Code for "GraphAIR: Graph Representation Learning with Neighborhood Aggregation and Interaction"
Python
11
star
20

AUG-MAE

Code for AAAI'24 paper "Rethinking Graph Masked Autoencoders through Alignment and Uniformity”.
Python
11
star
21

tgm-dlm

Code for AAAI24 paper Text-Guided Molecule Generation with Diffusion Language Model
Python
11
star
22

SCGAN

[ICME 2019] Source code and datasets for "Semi-supervised Compatibility Learning Across Categories for Clothing Matching"
Python
10
star
23

GHRM

[WWW 2021] Source code and datasets for the paper "Graph-based Hierarchical Relevance Matching Signals for Ad-hoc Retrieval".
Python
9
star
24

CF-FEND

[SIGIR 2022] Source code and datasets for "Bias Mitigation for Evidence-aware Fake News Detection by Causal Intervention".
Python
8
star
25

DESTINE

[CIKM 2021] Implementations for Disentangled Self-Attentive Neural Networks for Click-Through Rate Prediction
Python
7
star
26

RHGN

Source code for CIKM 2021 paper for Relation-aware Heterogeneous Graph for User Profiling
Python
7
star
27

GRMM

[AAAI 2021] PyTorch implementation for "A Graph-based Relevance Matching Model for Ad-hoc Retrieval"
Python
6
star
28

K-GHRM

The source code of K-GHRM
Python
4
star
29

HeterFC

Python
3
star
30

hetgsl

[CIKM 2021] Code and dataset for "Label-informed Graph Structure Learning for Node Classification"
Jupyter Notebook
1
star