Skip to content
Reinforcement Knowledge Graph Reasoning for Explainable Recommendation
Branch: master
Clone or download
Latest commit 8ce143f Jun 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
.gitignore upload dataset to git lfs Jun 19, 2019
README.md Update README.md Jun 24, 2019
data_utils.py update code Jun 19, 2019
kg_env.py update code Jun 22, 2019
knowledge_graph.py update code Jun 22, 2019
preprocess.py update code Jun 22, 2019
requirements.txt update requirement Jun 20, 2019
test_agent.py
train_agent.py update code Jun 22, 2019
train_transe_model.py update rl model Jun 20, 2019
transe_model.py update transE model Jun 18, 2019
utils.py update policy nn Jun 20, 2019

README.md

Reinforcement Knowledge Graph Reasoning for Explainable Recommendation

This repository contains the source code of the SIGIR 2019 paper "Reinforcement Knowledge Graph Reasoning for Explainable Recommendation" [2].

Datasets

Two Amazon datasets (Amazon_Beauty, Amazon_Cellphones) are available in the "data/" directory and the split is consistent with [1]. All four datasets used in this paper can be downloaded here.

Requirements

  • Python >= 3.6
  • PyTorch = 1.0

How to run the code

  1. Proprocess the data first:
python preprocess.py --dataset <dataset_name>

"<dataset_name>" should be one of "cd", "beauty", "cloth", "cell" (refer to utils.py).

  1. Train knowledge graph embeddings (TransE in this case):
python train_transe_model.py --dataset <dataset_name>
  1. Train RL agent:
python train_agent.py --dataset <dataset_name>
  1. Evaluation
python test_agent.py --dataset <dataset_name> --run_path True --run_eval True

If "run_path" is True, the program will generate paths for recommendation according to the trained policy. If "run_eval" is True, the program will evaluate the recommendation performance based on the resulting paths.

References

[1] Yongfeng Zhang, Qingyao Ai, Xu Chen, W. Bruce Croft. "Joint Representation Learning for Top-N Recommendation with Heterogeneous Information Sources". In Proceedings of CIKM. 2017.

[2] Yikun Xian, Zuohui Fu, S. Muthukrishnan, Gerard de Melo, Yongfeng Zhang. "Reinforcement Knowledge Graph Reasoning for Explainable Recommendation." In Proceedings of SIGIR. 2019.

You can’t perform that action at this time.