This is the Pytorch implementation of KGCN (arXiv):
Knowledge Graph Convolutional Networks for Recommender Systems
Hongwei Wang, Miao Zhao, Xing Xie, Wenjie Li, Minyi Guo.
In Proceedings of The 2019 Web Conference (WWW 2019)
-
Raw rating file for movie is too large to be contained in this repo.
Downlad the rating data first
$ wget http://files.grouplens.org/datasets/movielens/ml-20m.zip $ unzip ml-20m.zip $ mv ml-20m/ratings.csv data/movie/
-
Nothing to do
-
If you want to use your own dataset, you need to prepare 2 data.
- Rating data
- Each row should contain (user-item-rating)
- In this repo, it is pandas dataframe structure. (look at
data_loader.py
)
- Knowledge graph
- Each triple(head-relation-tail) consists of knowledge graph
- In this repo, it is dictionary type. (look at
data_loader.py
)
- Rating data
-
data_loader.py
- data loader class for movie / music dataset
- you don't need it if you make custom dataset
-
aggregator.py
- aggregator class which implements 3 aggregation functions
-
model.py
- KGCN model network
Look at the KGCN.ipynb
.
It contains
- how to construct Datset
- how to construct Data loader
- how to train network