Learning Intents behind Interactions with Knowledge Graph for Recommendation, WWW2021
This is our PyTorch implementation for the paper:
Xiang Wang, Tinglin Huang, Dingxian Wang, Yancheng Yuan, Zhenguang Liu, Xiangnan He and Tat-Seng Chua (2021). Learning Intents behind Interactions with Knowledge Graph for Recommendation. Paper in arXiv. In WWW'2021, Ljubljana, Slovenia, April 19-23, 2021.
Knowledge Graph-based Intent Network (KGIN) is a recommendation framework, which consists of three components: (1)user Intent modeling, (2)relational path-aware aggregation, (3)indepedence modeling.
If you want to use our codes and datasets in your research, please cite:
@inproceedings{KGIN2020,
author = {Xiang Wang and
Tinglin Huang and
Dingxian Wang and
Yancheng Yuan and
Zhenguang Liu and
Xiangnan He and
Tat{-}Seng Chua},
title = {Learning Intents behind Interactions with Knowledge Graph for Recommendation},
booktitle = {{WWW}},
pages = {878-887},
year = {2021}
}
The code has been tested running under Python 3.6.5. The required packages are as follows:
To demonstrate the reproducibility of the best performance reported in our paper and faciliate researchers to track whether the model status is consistent with ours, we provide the best parameter settings (might be different for the custormized datasets) in the scripts, and provide the log for our trainings.
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 --dim 64 --lr 0.0001 --sim_regularity 0.0001 --batch_size 1024 --node_dropout True --node_dropout_rate 0.5 --mess_dropout True --mess_dropout_rate 0.1 --gpu_id 0 --context_hops 3
python main.py --dataset amazon-book --dim 64 --lr 0.0001 --sim_regularity 0.00001 --batch_size 1024 --node_dropout True --node_dropout_rate 0.5 --mess_dropout True --mess_dropout_rate 0.1 --gpu_id 0 --context_hops 3
python main.py --dataset alibaba-fashion --dim 64 --lr 0.0001 --sim_regularity 0.0001 --batch_size 1024 --node_dropout True --node_dropout_rate 0.5 --mess_dropout True --mess_dropout_rate 0.1 --gpu_id 0 --context_hops 3
Important argument:
sim_regularity
We provide three processed datasets: Amazon-book, Last-FM, and Alibaba-iFashion.
Amazon-book | Last-FM | Alibaba-ifashion | ||
---|---|---|---|---|
User-Item Interaction | #Users | 70,679 | 23,566 | 114,737 |
#Items | 24,915 | 48,123 | 30,040 | |
#Interactions | 847,733 | 3,034,796 | 1,781,093 | |
Knowledge Graph | #Entities | 88,572 | 58,266 | 59,156 |
#Relations | 39 | 9 | 51 | |
#Triplets | 2,557,746 | 464,567 | 279,155 |
train.txt
userID
and a list of itemID
).test.txt
userID
and a list of itemID
).user_list.txt
org_id
, remap_id
) for one user, where org_id
and remap_id
represent the ID of such user in the original and our datasets, respectively.item_list.txt
org_id
, remap_id
, freebase_id
) for one item, where org_id
, remap_id
, and freebase_id
represent the ID of such item in the original, our datasets, and freebase, respectively.entity_list.txt
freebase_id
, remap_id
) for one entity in knowledge graph, where freebase_id
and remap_id
represent the ID of such entity in freebase and our datasets, respectively.relation_list.txt
freebase_id
, remap_id
) for one relation in knowledge graph, where freebase_id
and remap_id
represent the ID of such relation in freebase and our datasets, respectively.Any scientific publications that use our datasets should cite the following paper as the reference:
@inproceedings{KGIN2020,
author = {Xiang Wang and
Tinglin Huang and
Dingxian Wang and
Yancheng Yuan and
Zhenguang Liu and
Xiangnan He and
Tat{-}Seng Chua},
title = {Learning Intents behind Interactions with Knowledge Graph for Recommendation},
booktitle = {{WWW}},
pages = {878-887},
year = {2021}
}
Nobody guarantees the correctness of the data, its suitability for any particular purpose, or the validity of results based on the use of the data set. The data set may be used for any research purposes under the following conditions: