Knowledge Graph-enhanced Sampling for Conversational Recommendation System(KGenSam) is a Knowledge-enhanced framework tailored to conversational recommendation. KGenSam integrates the dynamic graph of user interaction data with the external knowledge into one heterogeneous Knowledge Graph(KG) as the contextual information environment. Then, two samplers are designed to enhance knowledge by sampling fuzzy samples with high uncertainty for obtaining user preferences and reliable negative samples for updating recommender to achieve efficient acquisition of user preferences and model updating, and thus provide a powerful solution for CRS to deal with E&E problem.
If you want to use our codes and datasets in your research, please cite:
@inproceedings{KGenSam,
author = {Mengyuan Zhao, Xiaowen Huang, Lixi Zhu, Jitao Sang, Jian Yu},
title = {Knowledge Graph-enhanced Sampling for Conversational Recommender System},
booktitle = {http://arxiv.org/abs/2110.06637},
pages = {},
year = {}
}
The training models are saved in folder run-log//-model. The training logs are recorded in folder run-log//-log and file run-log/.out .
0. Preparation
python base_config.py
The parser function of parameter settings is set in configuration/base_config.py.
python knowledge_graph.py
The knowledge graph is prepared in KG/knowledge_graph.py.
1. PreTrain FM
python 1_fm_train.py
The implementation codes of FM model are in the folder FM.
2. PreTrain Active Sampler and Negative Sampler
python 2_active_sampler_train.py
python 2_negative_sampler_train.py
The Sampler implementation codes are in the folder active-sampler and the folder negative-sampler respectively.
3. Train conversational Agent
python 3_run.py
The implementation codes of conversational Agent are in the conversational-policy/conversational_policy.py .
4. Evaluate conversational Agent
python 4_policy_evaluate.py
The evaluation codes of conversational Agent are in the conversational-policy/conversational_policy_evaluate.py .
We provide two processed datasets: Last-FM, and Yelp2018.
Dateset | LastFM | Yelp | |
---|---|---|---|
User-Item Interaction |
#Users | 1,801 | 27,675 |
#Items | 7,432 | 70,311 | |
#Interactions | 76,693 | 1,368,606 | |
#attributes | 8,438 | 590 | |
Graph | #Entities | 17,671 | 98,576 |
#Relations | 4 | 3 | |
#Triplets | 228,217 | 2,533,827 | |
Relations | Description | Number of Relations | |
Interact | user---item | 76,696 | 1,368,606 |
Friend | user---user | 23,958 | 688,209 |
Like | user---attribute | 33,120 | * |
Belong_to | item---attribute | 94,446 | 477,012 |
1. Graph Generate Data
user_item.json
userID
: a list of itemID
].tag_map.json
Real attributeID
: attributeID
].user_dict.json
userID
and the value of a dictionary entry is a new dict: (''friends'' : a list of userID
) & [''like'' : attributeID
]item_dict.json
itemID
and the value of a dictionary entry is a new dict: [''attribute_index'' : a list of attributeID
]2. FM Sample Data
sample_fm_data.pkl
(user_id, item_id, neg_item, cand_neg_item, prefer_attributes)
.user_pickle = pickle_file[0] user id
item_p_pickle = pickle_file[1] item id that has interacted with user
i_neg1_pickle = pickle_file[2] negative item id that has not interacted with user
i_neg2_pickle = pickle_file[3] negative item id that has not interacted with the user in the candidate item set
preference_pickle = pickle_file[4] the user’s preferred attributes in the current turn
3. UI Interaction Data
review_dict.json
4. KG Data
kg_final.txt
Any scientific publications that use our datasets should cite the following paper as the reference:
@inproceedings{KGenSam,
author = {Mengyuan Zhao, Xiaowen Huang, Lixi Zhu, Jitao Sang, Jian Yu},
title = {Knowledge Graph-enhanced Sampling for Conversational Recommender System},
booktitle = {http://arxiv.org/abs/2110.06637},
year = {}
}
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:
This work is supported by the National Key R&D Program of China (2018AAA0100604), the Fundamental Research Funds for the Central Universities (2021RC217), the Beijing Natural Science Foundation (JQ20023), the National Natural Science Foundation of China (61632002, 61832004, 62036012, 61720106006).
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。