GithubHelp home page GithubHelp logo

refactoring-summarization's Introduction

Refactoring-Summarization

Code for our paper: "RefSum: Refactoring Neural Summarization", NAACL 2021.

We present a model, Refactor, which can be used either as a base system or a meta system for text summarization.

Outline

1. How to Install

Requirements

  • python3
  • conda create --name env --file spec-file.txt
  • pip3 install -r requirements.txt

Description of Codes

  • main.py -> training and evaluation procedure
  • model.py -> Refactor model
  • data_utils.py -> dataloader
  • utils.py -> utility functions
  • demo.py -> off-the-shelf refactoring

2. How to Run

Hyper-parameter Setting

You may specify the hyper-parameters in main.py.

Train

python main.py --cuda --gpuid [list of gpuid] -l

Fine-tune

python main.py --cuda --gpuid [list of gpuid] -l --model_pt [model path]

Evaluate

python main.py --cuda --gpuid [single gpu] -e --model_pt [model path] --model_name [model name]

3. Off-the-shelf Refactoring

You may use our model with you own data by running

python demo.py DATA_PATH MODEL_PATH RESULT_PATH

DATA_PATH is the path of you data, which should be a file of which each line is in json format: {"article": str, "summary": str, "candidates": [str]}.

RESULT_PATH is the path of the result of which each line is a candidate summary.

4. Data

We use four datasets for our experiments.

You can find the processed data for all of our experiments here. After downloading, you should put the data in ./data directory.

Dataset Experiment Link
CNNDM Pre-train Download
BART Reranking Download
GSum Reranking Download
Two-system Combination (System-level) Download
Two-system Combination (Sentence-level) Download
Three-system Combination (System-level) Download
XSum Pre-train Download
PEGASUS Reranking Download
PubMed Pre-train Download
BART Reranking Download
WikiHow Pre-train Download
BART Reranking Download

5. Results

CNNDM

Reranking BART

ROUGE-1 ROUGE-2 ROUGE-L
BART 44.26 21.12 41.16
Refactor 45.15 21.70 42.00

Reranking GSum

ROUGE-1 ROUGE-2 ROUGE-L
GSum 45.93 22.30 42.68
Refactor 46.18 22.36 42.91

System-Combination (BART and pre-trained Refactor)

ROUGE-1 ROUGE-2 ROUGE-L
BART 44.26 21.12 41.16
pre-trained Refactor 44.13 20.51 40.29
Summary-Level Combination 45.04 21.61 41.72
Sentence-Level Combination 44.93 21.48 41.42

System-Combination (BART, pre-trained Refactor and GSum)

ROUGE-1 ROUGE-2 ROUGE-L
BART 44.26 21.12 41.16
pre-trained Refactor 44.13 20.51 40.29
GSum 45.93 22.30 42.68
Summary-Level Combination 46.12 22.46 42.92

XSum

Reranking PEGASUS

ROUGE-1 ROUGE-2 ROUGE-L
PEGASUS 47.12 24.46 39.04
Refactor 47.45 24.55 39.41

PubMed

Reranking BART

ROUGE-1 ROUGE-2 ROUGE-L
BART 43.42 15.32 39.21
Refactor 43.72 15.41 39.51

WikiHow

Reranking BART

ROUGE-1 ROUGE-2 ROUGE-L
BART 41.98 18.09 40.53
Refactor 42.12 18.13 40.66

refactoring-summarization's People

Contributors

pfliu-nlp avatar yixinl7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

refactoring-summarization's Issues

Question on Paper

Dear Yixin Liu,

I really enjoyed your paper on 2-stage learning framework utilizing the complementarity of different text summarization systems.

I have some questions about paper.

On your paper, you say as follows.
Sharing a set of parameters between base and meta system can alleviate the "Base-Meta learning gap".
And, pretrain-then-finetune paradiam can mitigate "Train-Test distribution gap".

But i think, there is no experiment indicating that sharing parameters between base-meta model can boost performance.
In $5.5 and $5.8 experiment, pre-trained Refactor is only used as meta learner. (base model is BART, GSum and PEGASUS)
In $5.6 experiment, pre-trained Refactor is also used as base model, but there is no parameter sharing between the other base model and meta model.

Is there any reason that pre-trained Refactor is not suitable as base model in re-ranking?
And is there performance difference when no parameter sharing with meta model (i.e. Refactor only used as meta model in multi-system) and when sharing parameter between meta and only one base model (in $5.6)?

please correct me if I got it wrong.

Thanks in advance.

Question about the data

The links provided in the document[README.md] 4.DATA are all not working, could you please re-share it?

Some questions about the paper

Hi! I'm just interested in your 2-stage work! It's exciting! But I'm just a little confused about :

  1. what's the meaning of "Min, Max and Random?"Does it mean that the ROUGE score of candidates? The min ROUGE one, the max ROUGE one and select one of them randomly?
    image
  2. Why does the pre-trained refactor get different rouge score on the same CNNDM dataset? Casue you both choose the combinations of sentences of source documents, so it should be equal, right?
    image

Please let me know if i got wrong, Thank you very much!

Some questions about the paper

Hi! I'm just interested in your 2-stage work! It's exciting! But I'm just a little confused about :

  1. what's the meaning of "Min, Max and Random?"Does it mean that the ROUGE score of candidates? The min ROUGE one, the max ROUGE one and select one of them randomly?
    image
  2. Why does the pre-trained refactor get different rouge score on the same CNNDM dataset? Casue you both choose the combinations of sentences of source documents, so it should be equal, right?

Please let me know if i got wrong, Thank you very much!

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.