This repo contains code and data for the paper: "Broadening the View: Demonstration-augmented Prompt Learning for Conversational Recommendation".
Please install libraries, packages listed in the conv/requirements.txt file. Make sure that you are using CUDA 11.6. Otherwise, some unexpected behaviors might happen.
You can download the processed data (including conv, rec, and retrieval data) from the following link.
For a fair comparison, we adopted the code from VRICR and UNICRS to process data for the recommendation engine and dialogue module respectively.
We build our retrieval module based on SimCSE . First, you need to generate data which is utilized to train our retrieval model.
python gen_data_for_retrieval.py
To train our retrieval module, please run
cd retrieval
sh run_unsup_example.sh
To generate retrieval data, please run
python test.py
For the ReDial dataset, to train our response generation model, please run:
cd conv
sh scripts/train_conv_retrieval_redial.sh
To produce generated responses, please run the following command:
sh scripts/infer_retrieval.sh
To train our recommendation engine, you need to first pre-train neural embeddings of demonstrations.
cd rec
sh scripts/pretrain.sh
To finetune our recommendation engine, please following commands:
sh scripts/train_rec.sh