Home

Awesome

CSRec

This is the official implementation for Common Sense Enhanced Knowledge-based Recommendation with Large Language Model

<div align=center> <img src="CSRec.png" alt="CSRec" width="100%" /> </div>

Requirements

python==3.7.12
recbole==1.0.1
torch==1.13.1
cudatoolkit==11.3.1

Getting Started

  1. Clone the repository and install requirements
git clone https://github.com/ysh-1998/CSRec.git
  1. Download data from Google Drive and put it in the dataset folder.
  2. Run model on the build-in dataset
python run_csrec.py --gpu_id=0 --model="CKE" --cs_kg_name="coms" --dataset="Electronics" --temperature=0.01
python run_csrec.py --gpu_id=0 --model="CFKG" --cs_kg_name="coms" --dataset="Electronics" --temperature=0.1
python run_csrec.py --gpu_id=0 --model="CKE" --cs_kg_name="coms" --dataset="Office" --temperature=0.1
python run_csrec.py --gpu_id=0 --model="CFKG" --cs_kg_name="coms" --dataset="Office" --temperature=0.3 --learning_rate=0.005
python run_base.py --gpu_id=0 --model="CKE" --kg_name="merge" --dataset="Electronics"
python run_base.py --gpu_id=0 --model="CKE" --kg_name="merge" --dataset="Office"
python run_base.py --gpu_id=0 --model="BPR" --dataset="Electronics"
python run_base.py --gpu_id=0 --model="BPR" --dataset="Office"