Effective question-asking is a crucial component of a successful conversational chatbot. It could help the bots manifest empathy and render the interaction more engaging by demonstrating attention to the speaker’s emotions. However, current dialog generation approaches do not model this subtle emotion regulation technique due to the lack of a taxonomy of questions and their purpose in social chitchat. To address this gap, we developed an empathetic question taxonomy (EQT), with special attention paid to questions’ ability to capture communicative acts (Question acts) and their emotion regulation intents (Question intents).
Question acts capture semantic-driven communicative actions of questions.
Question intents describe the emotional effect the question should have on the dialog partner.
We used an iterative qualitative coding method to manually annotate more than 310 listener questions from the EmpatheticDialogues dataset (Rashkin et al., 2019) using the above taxonomy. A larger sub-sample of the EmpatheticDialogues dataset was annotated recruiting crowdworkers from Amazon Mechanical Turk (MTurk) resulting in 6,433 questions assigned with a question act label and 5,826 questions assigned with a question intent label.
We extended the number of examples for each question act and intent by searching through the rest of the dataset using k-Nearest-Neighbors (k-NN) method. More specifically, we employed the Sentence-BERT (SBERT) framework (Reimers and Gurevych, 2019) to obtain embeddings for all questions with their contexts. Then we used the cosine similarity measure to find k labeled NNs for each question in the unlabeled set and assign the same labels to them. This produced additional 1,911 labels for question acts and 1,886 labels for question intents.
Using the human-annotated and augmented labels, we trained two classifiers, which we collectively call QBERT.
This repository contains the code used to train and evaluate the QBERT classifier, the datasets used for training and evaluation and the annotated results.
QBERT models for predicting question acts and intents have identical architecture and vary only in the number of output categories in the final layer. Each model consists of a BERT-based representation network, an attention layer, one hidden layer, and a softmax layer. For the representation network, we used the architecture with 12 layers, 768 dimensions, 12 heads,and 110M parameters. We initialized it with the weights of RoBERTa language model pre-trained by Liu et al. (2019) and for training used the same hyper-parameters as the authors.
The listener question and preceding dialog turns are fed into the classfier in the reverse order to obtain predictions.
Add the following weights files to the weights
folder:
https://drive.google.com/drive/folders/1zsPHHqs5rsIydBVER-T2wnyAqM0S6DS-?usp=sharing
Run python train_qbert.py [type/intent]
Run python predict_qbert.py [type/intent]
Our fine-tuned weights can be downloaded from here:
https://drive.google.com/drive/folders/1Z8edHY3HYFJOgYr4hJx0I3gvL37yDNmk?usp=sharing
numpy==1.19.2
tensorflow_gpu==2.5.0
tqdm==4.56.0
pytorch_transformers==1.2.0
pandas==1.2.3
scikit_learn==0.24.2
tensorflow==2.6.0
The original EmpatheticDialogues dataset can be downloaded from: github.com/facebookresearch/EmpatheticDialogues.
This repository contains the following datasets:
Please cite the following paper if you found the resources in this repository useful.
@inproceedings{svikhnushina-etal-2022-taxonomy,
title = "A Taxonomy of Empathetic Questions in Social Dialogs",
author = "Svikhnushina, Ekaterina and Voinea, Iuliana and Welivita, Anuradha and Pu, Pearl",
booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = may,
year = "2022",
address = "Dublin, Ireland",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.acl-long.211",
doi = "10.18653/v1/2022.acl-long.211",
pages = "2952--2973",
}
See the LICENSE file in the root repo folder for more details.