Skip to content
BiSET: Bi-directional Selective Encoding with Template for Abstractive Summarization
Python Perl Shell Emacs Lisp Java Smalltalk Other
Branch: master
Clone or download
Latest commit a697a3c Aug 4, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Bi-selective Encoding fix translate errors Aug 4, 2019
Retrieve/src/com/wk/lucene first commit Jun 11, 2019
.gitignore first commit Jun 11, 2019
LICENSE Initial commit Jun 11, 2019 fix translate errors Aug 4, 2019

BiSET: Bi-directional Selective Encoding with Template for Abstractive Summarization (ACL 2019)

This paper contains three basic module: Retrieve, FastRerank, Bi-selective Encoding. The following is the usage.


The Retrieve module is based on Apache Lucene, an open source search library. You should first download the core library from the website, and then build the java project. After that, you can index and search on the dataset by following steps:

  1. Change the path in the to your directory.
  2. Run to build the index of the trainning set. (This process may cost several days, but only need once.)
  3. Run to search for the candidates and generate the template index files.


The FastRerank module is implemented with pytorch, before run it, you should first prepare all the data (template index retrieved by Retrieve module and the raw dataset).

  1. Run python --mode preprocess to preprocess the data.
  2. Run python --mode train to train the model or python --mode train --model modelname to finetune a model. (eg. python --mode train --model model_final.pkl)
  3. Run python --mode dev --model modelname to evaluate or test the model, and the template with highest score will be stored.

Bi-selective Encoding

The Bi-selective Encoding module is integrated with OpenNMT. Now it only has the bi-selective encoding layer, I will add other three interaction methods (concate, multi-head attention, DCN attention) later. You can directly train it end to end with the data by following steps:

  1. Run python to prepare the data.
  2. Run python to train the model.
  3. Run python to generate the summaries.


  1. If you are not familiar with Java or think the first two steps are time-consuming, you can directly train the Bi-selective Encoding module with the retrieved&reranked templates and data in Google Disk.
  2. I refactor my code for clearity and conciseness (rename the variables and class), but I don't have enough time to do a thorough test. If the code has some problems or you have any questions, please raise an issue, I will figure it out whenever I'm available.
  3. For personal communication related to BiSET, please contact me (
You can’t perform that action at this time.