Coder Social home page Coder Social logo

sa-bert's Introduction

Speaker-Aware BERT for Multi-Turn Response Selection

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.

Results

Dependencies

Python 3.6
Tensorflow 1.13.1

Download

Adaptation

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.

Training

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

Testing

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

Cite

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

Update

Please feel free to open issues if you have some problems.

sa-bert's People

Contributors

jasonforjoy avatar

Watchers

 avatar

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.