This repository contains the code for the paper "Emotional RAG: Enhancing Role-Playing Agents through Emotional Retrieval," which has been accepted by ICKG2024. The project aims to enhance the capabilities of role-playing agents through emotional retrieval.
- Python Version: 3.12
- Other Library Versions: See
requirements.txt
-
Download Base Models:
-
Configure Model Paths and GPT Keys:
- Configure local model paths and GPT keys in
utils/config.py
. - Configure GPT keys for evaluation in
evaluation/config.json
.
- Configure local model paths and GPT keys in
-
Download CharacterEval Dataset:
wget https://github.com/morecry/CharacterEval/raw/refs/heads/main/data/test_data.jsonl wget https://raw.githubusercontent.com/morecry/CharacterEval/refs/heads/main/data/character_profiles.json
Place the files from the CharacterEval dataset into the
data/charactereval
directory. -
Generate query_bank:
python data/generate_query_bank.py
-
Generate the All Memory Bank for All Characters:
python data/charactereval/generate_qa_memory_bank.py
-
Generate Psychology Questionnaire Answers:
python get_response.py
-
Conduct Evaluation:
python evaluation/run_experiments.py
The evaluation plan uses the personality assessment from InCharacter.
If you use this project in your research, please cite the following paper:
@misc{huang2024emotionalragenhancingroleplaying,
title={Emotional RAG: Enhancing Role-Playing Agents through Emotional Retrieval},
author={Le Huang and Hengzhi Lan and Zijun Sun and Chuan Shi and Ting Bai},
year={2024},
eprint={2410.23041},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2410.23041},
}