Giter VIP home page Giter VIP logo

biset's Introduction

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.

Retrieve

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 Constants.java to your directory.
  2. Run Indexer.java to build the index of the trainning set. (This process may cost several days, but only need once.)
  3. Run Searcher.java to search for the candidates and generate the template index files.

FastRerank

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 config.py --mode preprocess to preprocess the data.
  2. Run python config.py --mode train to train the model or python config.py --mode train --model modelname to finetune a model. (eg. python config.py --mode train --model model_final.pkl)
  3. Run python config.py --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 preprocess.py to prepare the data.
  2. Run python train.py to train the model.
  3. Run python translate.py to generate the summaries.

Notice

  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 ([email protected]).

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.