This is the official implementation of the paper "SAQRec: Aligning Recommender Systems to User Satisfaction via Questionnaire Feedback" based on PyTorch.
The main implementation of SAQRec can be found in the file models/SAQRec.py
.
Check the following instructions for reproducing experiments.
All the hyper-parameter settings of SAQRec on both datasets can be found in files config/SAQRec_commercial.yaml
and config/SAQRec_kuairand.yaml
.
The settings of two datasets can be found in file config/const.py
.
Check folder data
for details.
Place data files in the folder data
.
Our experiments were done with the following python packages:
python==3.8.18
torch==1.10.1
numpy==1.24.1
scikit-learn==1.3.1
tqdm==4.66.1
PyYAML==6.0.1
Run codes in command line:
# Base model
python main.py --name base --workspace ./workspace/base --gpu_id 0 --epochs 100 --model Base --batch_size 512 --dataset_name kuairand --num_negs 2
# Propensity model
python main.py --name pro --workspace ./workspace/pro --gpu_id 0 --epochs 100 --model Pro_Model --batch_size 512 --dataset_name kuairand --num_negs 0
# Satisfaction model
python main.py --name satis --workspace ./workspace/satis --gpu_id 0 --epochs 100 --model Satis_Model --batch_size 512 --dataset_name kuairand --num_negs 0
# SAQRec
python main.py --name SAQRec --workspace ./workspace/SAQRec --gpu_id 0 --epochs 100 --model SAQRec --batch_size 512 --dataset_name kuairand --num_negs 2
Note: When training propensity and satisfaction models, comment out the test section of the main.py
After training, check log files, for example, workspace/SAQRec/log/default.log
.
We conducted the experiments based on the following environments:
- CUDA Version: 11.1
- OS: CentOS Linux release 7.4.1708 (Core)
- GPU: The NVIDIA® T4 GPU
- CPU: Intel(R) Xeon(R) Gold 6230R CPU @ 2.10GHz