This project builds upon the powerful attribute-based retrieval capabilities of RecBole, a comprehensive, flexible, and easy-to-use recommendation algorithm library.
We further integrate a User Decision Simulation module with the ReAct pipeline, enhancing the system's decision-making process for recommendation tasks.
- Sequential Recommendation Pretraining using ConditionSASRec.
- Attribute-Oriented Retrieval Tool construction with partial finetuning.
- ToolRec module for LLM-empowered recommendation.
- Evaluation Pipeline for recommendation performance analysis.
Prepare the base sequential recommender for attribute retrieval tools.
# Prepare dataset info
python run_recbole.py --model=SASRec --dataset=ml-1m --config_files=SAS_ml1m.yaml --dump_to_chat=True --chat_hislen=10 --seed=2023 --test_v=test
python run_recbole.py --model=SASRec --dataset=ml-1m --config_files=SAS_ml1m.yaml --dump_profile=True --test_v=test
# Sequential recommendation example
python run_recbole.py --model=SASRec --dataset=ml-1m --config_files=SAS_ml1m.yaml --dump_profile=False --gpu_id=0 --test_v=testNote: Update the saved model name in the YAML file:
pretrained_name: /SASRec-XXXX.pth
Partly train on the base RecTool and save model checkpoints.
python run_recbole.py --dataset=ml-1m --model=SASRec_AddInfo --config_files=SAS_ml1m.yaml --gpu_id=0 --show_progress=False --load_pretrain=True --freeze_Rec_Params=True --item_additional_usage=True --item_additional_feature=genre --side_feature_size=100 --bert_usage=True --test_v=test --pretrained_name=/SASRec-XXXX.pthNote: Save all fine-tuned file names in
utils.pyunderclass dataset_sideinfo.
For example, for ml-1m, includeNone,genre, andrelease_yearas mentioned in the paper.
Set the configuration in utils.py:
dataset_name = "ml-1m"
test_version = "test"
backbone_model = "SASRec"Run ToolRec:
nohup python chat_RecAct.py > SASRec_ml-1m_toolrec.txt 2>&1 &Edit chat_analysis.py to specify the file list:
file_list = ['SASRec_ml-1m_toolrec'] # saved nohup text file nameRun the evaluation:
python chat_analysis.pyYAML configs:
amazon-book.yamlSAS_ml1m.yamlyelp_rec.yaml
Python files:
utils.pychat_api.py(requires OpenAI API key)
Downloads:
dataset/glove/glove.6B.100d.txt
- This repo contains ml-1m in
./datasets/. - To use the original dataset, replace the item IDs using:
python replace_item_ID.py
- Alternatively, download the processed dataset from our Google Cloud link (TBA).
This project was made possible thanks to the contributions and inspiration from the following works:
- RecBole — A comprehensive, flexible, and easy-to-use recommendation algorithm library, which provides the foundation for our attribute-based retrieval capabilities.
- ReAct — A framework whose pipeline inspired the integration of our User Decision Simulation module, enhancing decision-making processes in recommendation tasks.
This code was written quite some time ago and is preserved in its original state for reference only. It has not been updated or maintained recently.
If you have any questions, feel free to contact via email: