Code for Our NAACL Findings 2024 paper "The Whole is Better than the Sum: Using Aggregated Demonstrations in In-Context Learning for Sequential Recommendation"
- Write your own OpenAI API keys into
LLMSRec_Syn/openai_api.yaml
. - Unzip dataset files.
For data preparation details, please refer to LLMRank's [data-preparation].
cd LLMSRec_Syn/dataset/ml-1m/; unzip ml-1m.inter.zip cd LLMSRec_Syn/dataset/Games/; unzip Games.inter.zip
- Install dependencies.
pip install -r requirements.txt
- Evaluate ChatGPT's zero-shot ranking abilities on ML-1M dataset.
cd LLMSRec_Syn/ python evaluate.py -m Rank_Aggregated(ours)/Rank_Nearest/Rank_Fiexed -d ML-1M
Please cite the following paper if you find our code helpful.
The experiments are conducted using the open-source recommendation library RecBole and LLMRank.