GithubHelp home page GithubHelp logo

txy77 / ievalm-crs Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 4.0 23.63 MB

About The official GitHub page for ''Rethinking the Evaluation for Conversational Recommendation in the Era of Large Language Models'' Resources

License: MIT License

Python 96.40% Shell 3.60%

ievalm-crs's Introduction

Rethinking the Evaluation for Conversational Recommendation in the Era of Large Language Models

This repo provides the source code & data of our paper: Rethinking the Evaluation for Conversational Recommendation in the Era of Large Language Models (Arxiv 2023).

๐Ÿ˜€ Overview

Highlights:

  • 1๏ธโƒฃ We are the first to examine ChatGPT in conversational recommendation systematically, the ability of which is underestimated in traditional evaluation approach.
  • ๐Ÿ’ก We propose a new interactive approach that employs LLM-based user simulators for evaluating CRSs.
  • ๐Ÿ” The recall@50 metric can be boosted from 0.218 to 0.739 on the redial dataset with our new interactive evaluation approach, even surpassing the currently leading CRS baseline.

we propose an interactive Evaluation approach based on LLMs named iEvaLM that harnesses LLM-based user simulators. We take the ground-truth items from the example as the user preference through the interaction, and use them to set up the persona of the simulated users by LLMs through instructions. To further make a comprehensive evaluation, we consider two types of interaction: attribute-based question answering and free-form chit-chat.

๐Ÿš€ Quick Start

Requirements

  • python == 3.9.16
  • pytorch == 1.13.1
  • transformers == 4.28.1
  • pyg == 2.3.0
  • accelerate == 0.18.0

Download Models

You can download our fine-tuned models from the link, which include recommendation and conversation models of KBRD, BARCOR and UniCRS. Please put the downloaded model into src/utils/model directory.

Interact with the user simulator

  • dataset: [redial, opendialkg]
  • mode: [ask, chat]
  • model: [kbrd, barcor, unicrs, chatgpt]
cd script
bash {dataset}/cache_item.sh 
bash {dataset}/{mode}_{model}.sh 

You can customize your iEvaLM-CRS by specifying these configs:

  • --api_key: your API key
  • --turn_num: number of conversation turns. We employ five-round interaction in iEvaLM-CRS.

After the execution, you will find detailed interaction information under "save_{turn_num}/{mode}/{model}/{dataset}/".

Evaluate

cd script
bash {dataset}/Rec_eval.sh

You can customize your iEvaLM-CRS by specifying these configs:

  • --turn_num: number of conversation turns.
  • --mode: [ask, chat]

After the execution, you will find evaluation results under "save_{turn_num}/result/{mode}/{model}/{dataset}.json".

๐ŸŒŸ Perfermance

Performance of CRSs and ChatGPT using different evaluation approaches.

Model KBRD BARCOR UniCRS ChatGPT
Evaluation Approach Original iEvaLM(attr) iEvaLM(free) Original iEvaLM(attr) iEvaLM(free) Original iEvaLM(attr) iEvaLM(free) Original iEvaLM(attr) iEvaLM(free)
ReDial R@1 0.028 0.039 0.035 0.031 0.034 0.034 0.050 0.053 0.107 0.037 0.191 0.146
R@10 0.169 0.196 0.198 0.170 0.201 0.190 0.215 0.238 0.317 0.174 0.536 0.440
R@50 0.366 0.436 0.453 0.372 0.427 0.467 0.413 0.520 0.602 - - -
OpenDialKG R@1 0.231 0.131 0.234 0.312 0.264 0.314 0.308 0.180 0.314 0.310 0.299 0.400
R@10 0.423 0.293 0.431 0.453 0.423 0.458 0.513 0.393 0.538 0.539 0.604 0.715
R@50 0.492 0.377 0.509 0.510 0.482 0.530 0.574 0.458 0.609 - - -

Persuasiveness of explanations generated by CRSs and ChatGPT.

Model Evaluation Approach ReDial OpenDialKG
KBRD Original 0.638 0.824
iEvaLM 0.766 0.862
BARCOR Original 0.667 1.149
iEvaLM 0.795 1.211
UniCRS Original 0.685 1.128
iEvaLM 1.015 1.314
ChatGPT Original 0.787 1.221
iEvaLM 1.331 1.513

CRSLab will support this interactive evaluation approach, the results in our paper will be updated soon.

๐Ÿ“ฎ Contact

If you have any questions for our paper or codes, please send an email to [email protected].

๐Ÿฆ Citing

Please cite the following paper if you find our code helpful.

@article{wang2023rethinking,
  title={Rethinking the Evaluation for Conversational Recommendation in the Era of Large Language Models},
  author={Wang, Xiaolei and Tang, Xinyu and Zhao, Wayne Xin and Wang, Jingyuan and Wen, Ji-Rong},
  journal={arXiv preprint arXiv:2305.13112},
  year={2023}
}

ievalm-crs's People

Contributors

txy77 avatar

Stargazers

 avatar  avatar Xiaolei Wang avatar

Forkers

rucaibox eirsteir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.