This repository contains the source code and pre-trained models for the CIKM 2020 paper Speaker-Aware BERT for Multi-Turn Response Selection in Retrieval-Based Chatbots by Gu et al.
Python 3.6
Tensorflow 1.13.1
-
Download the BERT released by the Google research, and move to path: ./uncased_L-12_H-768_A-12
-
We also provide the BERT adapted on the Ubuntu V1 dataset, and move to path: ./uncased_L-12_H-768_A-12_adapted. You just need to fine tune it to reproduce our results.
-
Download the Ubuntu V1 dataset, and move to path: ./data/Ubuntu_V1_Xu/Ubuntu_Corpus_V1
Create the adaptation data.
cd data/Ubuntu_V1_Xu/
python create_adaptation_data.py
Running the adaptation process.
cd scripts/
bash adaptation.sh
The adapted model will be saved to the path ./uncased_L-12_H-768_A-12_adapted
.
Modify the filenames in this folder to make it the same as those in Google's BERT.
Create the fine-tuning data.
cd data/Ubuntu_V1_Xu/
python create_finetuning_data.py
Running the fine-tuning process.
cd scripts/
bash ubuntu_train.sh
Modify the variable restore_model_dir
in ubuntu_test.sh
cd scripts/
bash ubuntu_v1_test.sh
A "output_test.txt" file which records scores for each context-response pair will be saved to the path of restore_model_dir
.
Modify the variable test_out_filename
in compute_metrics.py
and then run the following command, various metrics will be shown.
python compute_metrics.py
If you use the source code and pre-trained models, please cite the following paper: "Speaker-Aware BERT for Multi-Turn Response Selection in Retrieval-Based Chatbots" Jia-Chen Gu, Tianda Li, Quan Liu, Zhen-Hua Ling, Zhiming Su, Si Wei, Xiaodan Zhu. CIKM (2020)
@inproceedings{Gu:2020:SABERT:3340531.3412330,
author = {Gu, Jia-Chen and
Li, Tianda and
Liu, Quan and
Ling, Zhen-Hua and
Su, Zhiming and
Wei, Si and
Zhu, Xiaodan
},
title = {Speaker-Aware BERT for Multi-Turn Response Selection in Retrieval-Based Chatbots},
booktitle = {Proceedings of the 29th ACM International Conference on Information and Knowledge Management},
series = {CIKM '20},
year = {2020},
isbn = {978-1-4503-6859-9},
location = {Virtual Event, Ireland},
pages = {2041--2044},
url = {http://doi.acm.org/10.1145/3340531.3412330},
doi = {10.1145/3340531.3412330},
acmid = {3412330},
publisher = {ACM},
}
Please feel free to open issues if you have some problems.