Skip to content

BAI-LAB/EmotionalRAG

Repository files navigation

Emotional RAG: Enhancing Role-Playing Agents through Emotional Retrieval

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.

Environment Requirements

  • Python Version: 3.12
  • Other Library Versions: See requirements.txt

Installation Steps

STEP 1: Prepare Models and Configuration

  1. Download Base Models:

  2. 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.

STEP 2: Prepare Datasets

  1. 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.

  2. Generate query_bank:

    python data/generate_query_bank.py
  3. Generate the All Memory Bank for All Characters:

    python data/charactereval/generate_qa_memory_bank.py

STEP 3: Generate Psychology Questionnaire Answers and Evaluate

  1. Generate Psychology Questionnaire Answers:

    python get_response.py
  2. Conduct Evaluation:

    python evaluation/run_experiments.py

    The evaluation plan uses the personality assessment from InCharacter.

Citation

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},  
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages