This is the PyTorch Implementation for the paper VRKG4Rec (WSDM'23):
Lingyun Lu, Bang Wang, Zizhuo Zhang, Shenghao Liu and Han Xu. VRKG4Rec: Virtual Relational Knowledge Graph for Recommendation.
Virtual Relational Knowledge Graph for Recommendation (VRKG4Rec) is a knowledge-aware recommendation framework, which explicitly distinguishes the influence of different relations for item representation learning and design a local weighted smoothing (LWS) mechanism for user and item encoding.
If you want to use our codes and datasets in your research, please cite:
@inproceedings{10.1145/3539597.3570482,
author = {Lu, Lingyun and Wang, Bang and Zhang, Zizhuo and Liu, Shenghao and Xu, Han},
title = {VRKG4Rec: Virtual Relational Knowledge Graph for Recommendation},
year = {2023},
isbn = {9781450394079},
publisher = {Association for Computing Machinery},
url = {https://doi.org/10.1145/3539597.3570482},
doi = {10.1145/3539597.3570482},
booktitle = {Proceedings of the Sixteenth ACM International Conference on Web Search and Data Mining},
series = {WSDM '23}
}
The code has been tested running under Python 3.8.0. The required packages are as follows:
The instruction of commands has been clearly stated in the codes (see the parser function in utils/parser.py).
python main.py --dataset last-fm --lr 0.0001 --n_virtual 3 --context_hops 2 --n_iter 3
python main.py --dataset MovieLens --lr 0.0001 --n_virtual 3 --context_hops 2 --n_iter 3
We provide three processed datasets: Last-FM and MovieLens.
Last-FM | MovieLens | ||
---|---|---|---|
User-Item Interaction | #Users | 1,872 | 6,036 |
#Items | 3,915 | 2,347 | |
#Interactions | 42,346 | 753,772 | |
Knowledge Graph | #Entities | 9,366 | 6,729 |
#Relations | 60 | 7 | |
#Triplets | 15,518 | 20,195 |