The source code for "Global Context Enhanced Graph Neural Network for Session-based Recommendation".

Overview

GCE-GNN

Code

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

Requirements

  • Python 3
  • PyTorch >= 1.3.0
  • tqdm

Usage

Data preprocessing:

The code for data preprocessing can refer to SR-GNN.

Train and evaluate the model:

python build_graph.py --dataset diginetica --sample_num 12
python main.py --dataset diginetica

Citation

@inproceedings{wang2020global,
    title={Global Context Enhanced Graph Neural Networks for Session-based Recommendation},
    author={Wang, Ziyang and Wei, Wei and Cong, Gao and Li, Xiao-Li and Mao, Xian-Ling and Qiu, Minghui},
    booktitle={Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval},
    pages={169--178},
    year={2020}
}
Comments
  • About the Tmall datasets

    About the Tmall datasets

    Hi, Thanks for your sharing of this paper! About the datasets Tmall, I find the website you provide in your paper and download the datasets. But I find that in the test dataset, there are no given labels for it. Only the training set has labels. So would you mind share the Tmall test dataset with sessions' labels for us? Thanks!

    opened by xiaxin1998 6
  • 论文公式2

    论文公式2

    论文公式2 图片和代码 alpha = torch.matmul(torch.cat([extra_vector.unsqueeze(2).repeat(1, 1, neighbor_vector.shape[2], 1), neighbor_vector, neighbor_weight.unsqueeze(-1)], -1), self.w_1).squeeze(-1) 不一致,感觉论文公式有误?

    opened by SiriusXT 5
  • About preprocessing on Nowplaying

    About preprocessing on Nowplaying

    Hi, Thanks for your sharing of this paper! In your paper, I can't find whether you sort the session based on timestamp in Nowplaying datasets. The preprocess is unclear. Would you mind sharing the preprocessed datasets Nowplaying? Thanks!

    Best regards

    opened by xiaxin1998 3
  • build_graph时超参数sample_num在另外两个数据集Tmall和Nowplaying的设置值

    build_graph时超参数sample_num在另外两个数据集Tmall和Nowplaying的设置值

    python build_graph.py时,已经知道diginetica的sample_num设置为12。但是,数据集Tmall和Nowplaying的超参数sample_num没有给出。请问作者可以给出sample_num在数据集Tmall和Nowplaying上进行build_graph时的设置值吗?

    opened by MSJeinlong 2
  • Why reverse the sequence?

    Why reverse the sequence?

    reverse the sequence

    us_pois = [list(reversed(upois)) + [0] * (max_len - le) if le < max_len else list(reversed(upois[-max_len:])) for upois, le in zip(inputData, len_data)]

    Why reverse the sequence? Thank you.

    opened by caiyongqi 2
  • Question about dataset 'Tmall'

    Question about dataset 'Tmall'

    Thanks for sharing this awesome project! In the RecSys work, https://github.com/andrebola/session-rec-effect, the information about dataset 'Tmall' is inconsistent with that in your paper. And you didn't provide a code to prepare the dataset. So I want to know how that inconsistency exists and hopefully you can provide a guidance in README to help evaluate this project on the Tmall dataset. Great thanks in advance!

    opened by ZorrowHu 2
  • Data_preprocess

    Data_preprocess

    Excuse me, at present, I plan to add some other information in the data set to the session-based recommendation task to improve the recommendation accuracy (such as timestamp), and plan to cite and compare your GCE-GNN model. According to what you mentioned in the paper, I have downloaded the original data of the data set Tmall from IJCAI-15 competition(https://tianchi.aliyun.com/dataset/dataDetail?dataId=42) The original Tmall data set contains the information I want to use, but I can’t find the data set 'tmall_data.csv' mentioned in your preprocessing file 'process_tmall.py' . Could you please send me the code for preprocessing the raw data, or send me the relevant processed files 'tmall_data.csv' if convenient, thank you very very much !

    opened by whatever0228 1
  • 信息传递和信息汇聚问题

    信息传递和信息汇聚问题

    你好,想问一下,论文里全局图信息传播只发生在session内节点vi和vi的邻居节点之间,论文中的多跳是指什么意思呢? 就是正常情况下,一个节点想要利用到其二跳节点的信息,首先肯定是要从二跳节点传递到一跳节点,然后下一层卷积再发生二跳到当前节点的传递。可是论文中只写了当前节点和它的1-hop之间的信息传递。

    opened by gaozhanfire 1
  • Question w.r.t data processing

    Question w.r.t data processing

    According to your code in utils.py:

        for i in np.arange(len(u_input) - 1):
                u = np.where(node == u_input[i])[0][0]
                u_adj[u][u] = 1
                if u_input[i + 1] == 0:
                    break
                v = np.where(node == u_input[i + 1])[0][0]
                if u_adj[u][v] == 2:
                    u_adj[v][u] = 4
                else:
                    u_adj[v][u] = 3
                if u_adj[v][u] == 3:
                    u_adj[u][v] = 4
                else:
                    u_adj[u][v] = 2
                u_adj[v][v] = 1
    

    It seems that u_adj[u][v] will never be set as 2. I test the code on Diginetica and u_adj[u][v] = 2 never happens. Is this a bug or can you show us an example for it? What does 2 stand for?

    Thank you.

    opened by familyld 1
  • Validation

    Validation

    Excuse me. Does the model that get the results recorded in the paper use the validation set for training? Are the hyperparameters obtained on the validation set first, and then the model is retrained on the training set and validation set? I can't seem to get the results in the paper.

    opened by caiyongqi 0
  • n_node about the datasets

    n_node about the datasets

    Good job!Could I answer a question?Why the n_node is equal items+1 for diginetica, but are equal items for Nowplaying and Tmall? I reference items from the paper GCE-GNN.

    opened by LunarCM 0
  • Could you release the FGNN code?

    Could you release the FGNN code?

    Excellent work! I found that you reproduce the FGNN in your paper,because the original FGNN code is incomplete.Could you release your FGNN code?Thank you.

    opened by Karty-sun 0
Owner
null
Empirical Study of Transformers for Source Code & A Simple Approach for Handling Out-of-Vocabulary Identifiers in Deep Learning for Source Code

Transformers for variable misuse, function naming and code completion tasks The official PyTorch implementation of: Empirical Study of Transformers fo

Bayesian Methods Research Group 56 Nov 15, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Code for our paper "Transfer Learning for Sequence Generation: from Single-source to Multi-source" in ACL 2021.

TRICE: a task-agnostic transferring framework for multi-source sequence generation This is the source code of our work Transfer Learning for Sequence

THUNLP-MT 9 Jun 27, 2022
chiarose(XCR) based on chia(XCH) source code fork, open source public chain

chia-rosechain 一个无耻的小活动 | A shameless little event 如果您喜欢这个项目,请点击star 将赠送您520朵玫瑰,可以去 facebook 留下您的(xcr)地址,和github用户名。 If you like this project, please

ddou123 376 Dec 14, 2022
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
Programmatically edit text files with Python. Useful for source to source transformations.

massedit formerly known as Python Mass Editor Implements a python mass editor to process text files using Python code. The modification(s) is (are) sh

null 106 Dec 17, 2022
Source-to-Source Debuggable Derivatives in Pure Python

Tangent Tangent is a new, free, and open-source Python library for automatic differentiation. Existing libraries implement automatic differentiation b

Google 2.2k Jan 1, 2023
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
Django project starter on steroids: quickly create a Django app AND generate source code for data models + REST/GraphQL APIs (the generated code is auto-linted and has 100% test coverage).

Create Django App ?? We're a Django project starter on steroids! One-line command to create a Django app with all the dependencies auto-installed AND

imagine.ai 68 Oct 19, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation

CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation. The code should run on any Linux system, from massively parallel computer clusters to laptops.

Jeppe Dakin 62 Dec 8, 2022
This is discord nitro code generator and checker made with python. This will generate nitro codes and checks if the code is valid or not. If code is valid then it will print the code leaving 2 lines and if not then it will print '*'.

Discord Nitro Generator And Checker ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast

Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ 37 Jan 7, 2023
Grumpy is a Python to Go source code transcompiler and runtime.

Grumpy: Go running Python Overview Grumpy is a Python to Go source code transcompiler and runtime that is intended to be a near drop-in replacement fo

Google 10.6k Dec 24, 2022
Graph Transformer Architecture. Source code for

Graph Transformer Architecture Source code for the paper "A Generalization of Transformer Networks to Graphs" by Vijay Prakash Dwivedi and Xavier Bres

NTU Graph Deep Learning Lab 561 Jan 8, 2023
A library that modifies python source code to conform to pep8.

Pep8ify: Clean your code with ease Pep8ify is a library that modifies python source code to conform to pep8. Installation This library currently works

Steve Pulec 117 Jan 3, 2023
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.

Freedom to build what you want FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history to change its parameters.

FreeCAD 12.9k Jan 7, 2023