Data and codes for ACL 2021 paper: Towards Emotional Support Dialog Systems

Overview

Emotional-Support-Conversation

Copyright © 2021 CoAI Group, Tsinghua University. All rights reserved. Data and codes are for academic research use only.

Data and codes for the ACL 2021 paper: Towards Emotional Support Dialog Systems

If you use our codes or your research is related to our paper, please kindly cite our paper:

@inproceedings{liu-etal-2021-towards,
  title={Towards Emotional Support Dialog Systems},
  author={Liu, Siyang  and 
    Zheng, Chujie  and 
    Demasi, Orianna  and 
    Sabour, Sahand  and 
    Li, Yu  and 
    Yu, Zhou  and 
    Jiang, Yong  and 
    Huang, Minlie},
  booktitle={Proceedings of the 59th annual meeting of the Association for Computational Linguistics},
  year={2021}
}

Data

The corpus file is ESConv.json. We have collected more conversations with more problem topics. ESConv now contians 1,300 conversations with 10 topic problems.

Statistics

Problem Category

Problem Category ongoing depression breakup with partner job crisis problems with friends academic pressure procras-
tination*
alcohol abuse* issues with parent* sleep problems* appearance anxiety* school bullying* issues with children*
Number 351 239 280 179 156 13 12 18 28 12 2 10

* denotes the new topics added during the second collection. We hope new data supports the future research in transferring the ability of models from old topics to new ones.

Strategy Category

Strategy Category Number
Questions 3801(20.7%)
Self-disclosure 1713(9.3%)
Affirmation and Reassurance 2827(15.4%)
Providing Suggestions 2954(16.1%)
Other 3661(18.3%) / 3341(18.2%)
Reflection of feelings 1436(7.8%)
Information 1215(6.6%)
Restatement or Paraphrasing 1089(5.9%)

Model Implementation

We provide two versions of model implementation:

  • codes is the version that we used in the original experiments
  • codes_zcj is the version reproduced by @chujiezheng
Comments
  • a question about the backbone models

    a question about the backbone models

    Hi,

    Great work! I was wondering whether it is possible to change the English task into a Chinese task. Do you think it is possible to make the strategy come true through the Chinese data and the Chinese model?

    Thanks for your reply!

    opened by BaiMeiyingxue 12
  • a question about interact with strategy

    a question about interact with strategy

    在进行交互的 前有限轮对话中,当所有对话内容tokenize之后的总长度小于max_input_length时,AI回复的strategy一直保持不变,直到tokenize之后的总长度大于max_input_length后,因为这时候开始做max_input_length的截断了,strat_dialogpt.py中predict_strategy函数中切片的logits才会变化,AI回复的strategy才会变,想问一下,是就这么设计的,还是其他原因啊?

    good first issue 
    opened by ChuangqHu 10
  • 运行interact_strat.sh时,一直提示KeyError: 'strategy'。请求解决谢谢

    运行interact_strat.sh时,一直提示KeyError: 'strategy'。请求解决谢谢

    错误如下: 用户无论输入什么,机器都提示策略错误。是找不到策略吗?求作者解答 谢谢 A new conversation starts! Human: hi Traceback (most recent call last): File "/root/Emotional-Support-Conversation-main/codes_zcj/interact.py", line 168, in inputs = inputter.convert_data_to_inputs(history, toker, **dataloader_kwargs) File "/root/Emotional-Support-Conversation-main/codes_zcj/inputters/strat.py", line 87, in convert_data_to_inputs strat_id = process('[' + dialog[i]['strategy'] + ']') KeyError: 'strategy'

    opened by caoyaru123 6
  • Size mismatch

    Size mismatch

    size mismatch for final_logits_bias: copying a param with shape torch.Size([1, 54953]) from checkpoint, the shape in current model is torch.Size([1, 54944]). size mismatch for model.shared.weight: copying a param with shape torch.Size([54953, 512]) from checkpoint, the shape in current model is torch.Size([54944, 512]). size mismatch for model.encoder.embed_tokens.weight: copying a param with shape torch.Size([54953, 512]) from checkpoint, the shape in current model is torch.Size([54944, 512]). size mismatch for model.decoder.embed_tokens.weight: copying a param with shape torch.Size([54953, 512]) from checkpoint, the shape in current model is torch.Size([54944, 512]). size mismatch for lm_head.weight: copying a param with shape torch.Size([54953, 512]) from checkpoint, the shape in current model is torch.Size([54944, 512]).

    我把从 https://huggingface.co/lsy641/ESC_Blender_noStrategy/tree/main 的模型放到blend-small文件夹下面之后,运行Python BlenderEmotionalSupport.py 文件, 遇到了这个维度不匹配的错误,请问这是怎么回事呢?

    opened by lwgkzl 5
  • Why not

    Why not "next_strategy_id" used in Blender mode code?

    I see "next_strategy_id" is not used in the Emotional-Support-Conversation/codes/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py.

    Except for useless code for role and turn id, I can't tell more code differences between codes/src/transformers and huggingface transformers.

    That is to say, I can successfully reproduce your result only by data preprocess adding strategy. Right?

    opened by nanzhao 5
  • Training loss suddenly decrease at the beginning of each epoch.

    Training loss suddenly decrease at the beginning of each epoch.

    Hi,

    I use the code in codes to train model. But I find a strange phenomenon that the loss suddenly decreases at the beginning of every epoch.

    So, my question is that is this the same as your training curve? and why does it suddenly decrease at the beginning of every epoch? I thought about it for a long time, but I still can't figure it out. Thanks a lot! image

    opened by Tebmer 4
  • a question about interact_strat

    a question about interact_strat

    Hi! Great work! I wanted to interact with the bot with strategy, so I trained the model following train_strat.sh. then I wanted to interact with the trained model and run interact_strat.sh. However, I get errors in inputters/strat.py How could I solve the problem?

    /workspace/Dialogue/Emotional-Support-Conversation/codes_zcj# bash RUN/interact_strat.sh 06/07/2022 00:58:18 - INFO - utils.building_utils - loading finetuned model from /workspace/Dialogue/Emotional-Support-Conversation/codes_zcj/DATA/strat.strat/2022-06-07004140.3e-05.16.1gpu/epoch-1.bin 06/07/2022 00:58:19 - INFO - utils.building_utils - deploying model...

    A new conversation starts! Human: Hi! Traceback (most recent call last): File "interact.py", line 168, in inputs = inputter.convert_data_to_inputs(history, toker, **dataloader_kwargs) File "/workspace/Dialogue/Emotional-Support-Conversation/codes_zcj/inputters/strat.py", line 87, in convert_data_to_inputs strat_id = process('[' + dialog[i]['strategy'] + ']') KeyError: 'strategy'

    opened by jeesoobang 3
  • interact_issue

    interact_issue

    Hello, I recently encountered a problem in replicating your code. I tried to train the model _strat with strategies, but there was some problem in the final interact process. Do you ever encounter it? Looking forward to your reply! bug

    opened by xielaobanyy 2
  • a question about train

    a question about train

    在数据prepare的时候: labels = ([strat_id] + response + [eos])[:max_decoder_input_length + 1] decoder_input_ids = [bos] + labels[:-1] label的第一个值是strat_id对应的token_id,decoder_input_ids 的第一个值是bos对应的token_id. 训练过程中计算loss的时候:loss = F.cross_entropy(lm_logits.view(-1, lm_logits.size(-1)), labels.view(-1), reduction='none'),lm_logits计算的原始输入是decoder_input_ids ,与label进行cross_entropy,每个response的第一个token_id是不是对应错了??求大佬指导

    opened by ChuangqHu 2
  • No model file found in codes

    No model file found in codes

    when I ran the code python BlenderEmotionalSupport.py, I got an error:

    OSError: Error no file named ['pytorch_model.bin', 'tf_model.h5', 'model.ckpt.index'] found in directory ./blender-small or from_tf set to False

    After downloading model file in this link, then changing the self.output_dir in class Args() , I got following error

    Traceback (most recent call last): File "/data00/home/zhushaojin/work_dir/20210701_ESC/Emotional-Support-Conversation/codes/src/transformers/modeling_utils.py", line 1038, in from_pretrained state_dict = torch.load(resolved_archive_file, map_location="cpu") File "/home/zhushaojin/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/zhushaojin/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "BlenderEmotionalSupport.py", line 1020, in generate() File "BlenderEmotionalSupport.py", line 920, in generate from_tf=False, File "/data00/home/zhushaojin/work_dir/20210701_ESC/Emotional-Support-Conversation/codes/src/transformers/modeling_utils.py", line 1041, in from_pretrained f"Unable to load weights from pytorch checkpoint file for '{pretrained_model_name_or_path}' " OSError: Unable to load weights from pytorch checkpoint file for '/home/zhushaojin/work_dir/20210701_ESC/blenderbot_small-90M' at '/home/zhushaojin/work_dir/20210701_ESC/blenderbot_small-90M/pytorch_model.bin'If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

    How can I get the correct model for running BlenderEmotionalSupport.py in codes?

    opened by Adam-fei 1
  • 运行infer_strat.sh时显示ValueError

    运行infer_strat.sh时显示ValueError

    您好,我运行infer_strat.sh时会出现下面的问题,想咨询下作者解决的方法,谢谢 Traceback (most recent call last): File "/root/Emotional-Support-Conversation-main/codes_zcj/prepare.py", line 36, in toker = build_model(only_toker=True, **names) File "/root/Emotional-Support-Conversation-main/codes_zcj/utils/building_utils.py", line 27, in build_model raise ValueError ValueError

    opened by fengyulin001 0
Owner
Conversational AI groups from Tsinghua University
null
Codes for paper "Towards Diverse Paragraph Captioning for Untrimmed Videos". CVPR 2021

Towards Diverse Paragraph Captioning for Untrimmed Videos This repository contains PyTorch implementation of our paper Towards Diverse Paragraph Capti

Yuqing Song 61 Oct 11, 2022
Emotional conditioned music generation using transformer-based model.

This is the official repository of EMOPIA: A Multi-Modal Pop Piano Dataset For Emotion Recognition and Emotion-based Music Generation. The paper has b

hung anna 96 Nov 9, 2022
Implementation of "StrengthNet: Deep Learning-based Emotion Strength Assessment for Emotional Speech Synthesis"

StrengthNet Implementation of "StrengthNet: Deep Learning-based Emotion Strength Assessment for Emotional Speech Synthesis" https://arxiv.org/abs/2110

RuiLiu 65 Dec 20, 2022
Implementation of EMNLP 2017 Paper "Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog" using PyTorch and ParlAI

Language Emergence in Multi Agent Dialog Code for the Paper Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog Satwik Kottur, José M.

Karan Desai 105 Nov 25, 2022
Implementation of EMNLP 2017 Paper "Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog" using PyTorch and ParlAI

Language Emergence in Multi Agent Dialog Code for the Paper Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog Satwik Kottur, José M.

Karan Desai 105 Nov 25, 2022
Data and Code for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning"

Introduction Code and data for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning". We cons

Pan Lu 81 Dec 27, 2022
Code for Talk-to-Edit (ICCV2021). Paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog.

Talk-to-Edit (ICCV2021) This repository contains the implementation of the following paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog Yumin

Yuming Jiang 221 Jan 7, 2023
Code and data of the ACL 2021 paper: Few-Shot Text Ranking with Meta Adapted Synthetic Weak Supervision

MetaAdaptRank This repository provides the implementation of meta-learning to reweight synthetic weak supervision data described in the paper Few-Shot

THUNLP 5 Jun 16, 2022
null 190 Jan 3, 2023
Code for Private Recommender Systems: How Can Users Build Their Own Fair Recommender Systems without Log Data? (SDM 2022)

Private Recommender Systems: How Can Users Build Their Own Fair Recommender Systems without Log Data? (SDM 2022) We consider how a user of a web servi

joisino 20 Aug 21, 2022
VD-BERT: A Unified Vision and Dialog Transformer with BERT

VD-BERT: A Unified Vision and Dialog Transformer with BERT PyTorch Code for the following paper at EMNLP2020: Title: VD-BERT: A Unified Vision and Dia

Salesforce 44 Nov 1, 2022
🌈 PyTorch Implementation for EMNLP'21 Findings "Reasoning Visual Dialog with Sparse Graph Learning and Knowledge Transfer"

SGLKT-VisDial Pytorch Implementation for the paper: Reasoning Visual Dialog with Sparse Graph Learning and Knowledge Transfer Gi-Cheon Kang, Junseok P

Gi-Cheon Kang 9 Jul 5, 2022
Code for SIMMC 2.0: A Task-oriented Dialog Dataset for Immersive Multimodal Conversations

The Second Situated Interactive MultiModal Conversations (SIMMC 2.0) Challenge 2021 Welcome to the Second Situated Interactive Multimodal Conversation

Facebook Research 81 Nov 22, 2022
Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer

ConSERT Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer Requirements torch==1.6.0

Yan Yuanmeng 478 Dec 25, 2022
PyTorch implementation for ACL 2021 paper "Maria: A Visual Experience Powered Conversational Agent".

Maria: A Visual Experience Powered Conversational Agent This repository is the Pytorch implementation of our paper "Maria: A Visual Experience Powered

Jokie 22 Dec 12, 2022
Code for our paper "SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization", ACL 2021

SimCLS Code for our paper: "SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization", ACL 2021 1. How to Install Requirements

Yixin Liu 150 Dec 12, 2022
Code for our ACL 2021 paper "One2Set: Generating Diverse Keyphrases as a Set"

One2Set This repository contains the code for our ACL 2021 paper “One2Set: Generating Diverse Keyphrases as a Set”. Our implementation is built on the

Jiacheng Ye 63 Jan 5, 2023
code associated with ACL 2021 DExperts paper

DExperts Hi! This repository contains code for the paper DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Experts to appear at

Alisa Liu 68 Dec 15, 2022
Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming

Code for ACL'2021 paper WARP ?? Word-level Adversarial ReProgramming. Outperforming `GPT-3` on SuperGLUE Few-Shot text classification.

YerevaNN 75 Nov 6, 2022