All Projects → lliangchenc → DeepChannel

lliangchenc / DeepChannel

Licence: other
The pytorch implementation of paper "DeepChannel: Salience Estimation by Contrastive Learning for Extractive Document Summarization"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to DeepChannel

Textrank
😉 🌀 🍓 TextRank implementation in Golang with extendable features (summarization, phrase extraction) and multithreading (goroutine) support (Go 1.8, 1.9, 1.10)
Stars: ✭ 125 (+420.83%)
Mutual labels:  summarization
Pyrouge
A Python wrapper for the ROUGE summarization evaluation package
Stars: ✭ 192 (+700%)
Mutual labels:  summarization
pn-summary
A well-structured summarization dataset for the Persian language!
Stars: ✭ 29 (+20.83%)
Mutual labels:  summarization
Neusum
Code for the ACL 2018 paper "Neural Document Summarization by Jointly Learning to Score and Select Sentences"
Stars: ✭ 143 (+495.83%)
Mutual labels:  summarization
Adversarial video summary
Unofficial PyTorch Implementation of SUM-GAN from "Unsupervised Video Summarization with Adversarial LSTM Networks" (CVPR 2017)
Stars: ✭ 187 (+679.17%)
Mutual labels:  summarization
Sumy
Module for automatic summarization of text documents and HTML pages.
Stars: ✭ 2,705 (+11170.83%)
Mutual labels:  summarization
Haystack
🔍 Haystack is an open source NLP framework that leverages Transformer models. It enables developers to implement production-ready neural search, question answering, semantic document search and summarization for a wide range of applications.
Stars: ✭ 3,409 (+14104.17%)
Mutual labels:  summarization
Machine-Learning-Notes
Lecture Notes of Andrew Ng's Machine Learning Course
Stars: ✭ 60 (+150%)
Mutual labels:  summarization
Textrank
🌀 ⚡️ 🌍 TextRank (automatic text summarization) for PHP8
Stars: ✭ 193 (+704.17%)
Mutual labels:  summarization
ConDigSum
Code for EMNLP 2021 paper "Topic-Aware Contrastive Learning for Abstractive Dialogue Summarization"
Stars: ✭ 62 (+158.33%)
Mutual labels:  summarization
Pythonrouge
Python wrapper for evaluating summarization quality by ROUGE package
Stars: ✭ 155 (+545.83%)
Mutual labels:  summarization
Cx db8
a contextual, biasable, word-or-sentence-or-paragraph extractive summarizer powered by the latest in text embeddings (Bert, Universal Sentence Encoder, Flair)
Stars: ✭ 164 (+583.33%)
Mutual labels:  summarization
Summarization Papers
Summarization Papers
Stars: ✭ 238 (+891.67%)
Mutual labels:  summarization
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (+495.83%)
Mutual labels:  summarization
Paribhasha
paribhasha.herokuapp.com/
Stars: ✭ 21 (-12.5%)
Mutual labels:  summarization
Files2rouge
Calculating ROUGE score between two files (line-by-line)
Stars: ✭ 120 (+400%)
Mutual labels:  summarization
Text summarization with tensorflow
Implementation of a seq2seq model for summarization of textual data. Demonstrated on amazon reviews, github issues and news articles.
Stars: ✭ 226 (+841.67%)
Mutual labels:  summarization
factsumm
FactSumm: Factual Consistency Scorer for Abstractive Summarization
Stars: ✭ 83 (+245.83%)
Mutual labels:  summarization
FocusSeq2Seq
[EMNLP 2019] Mixture Content Selection for Diverse Sequence Generation (Question Generation / Abstractive Summarization)
Stars: ✭ 109 (+354.17%)
Mutual labels:  summarization
SRB
Code for "Improving Semantic Relevance for Sequence-to-Sequence Learning of Chinese Social Media Text Summarization"
Stars: ✭ 41 (+70.83%)
Mutual labels:  summarization

DeepChannel

This repository is the pytorch implementation of paper

DeepChannel: Salience Estimation by Contrastive Learning for Extractive Document Summarization.

Jiaxin Shi*, Chen Liang*, Lei Hou, Juanzi Li, Zhiyuan Liu, Hanwang Zhang.

In this paper, we propose DeepChannel, a robust, data-efficient, and interpretable neural model for extractive document summarization. Given any document-summary pair, we estimate a salience score, which is modeled using an attention-based deep neural network, to represent the salience degree of the summary for yielding the document. We devise a contrastive training strategy to learn the salience estimation network, and then use the learned salience score as a guide and iteratively extract the most salient sentences from the document as our generated summary.

If you find this code useful in your research, please cite

@Inproceedings{Shi2018DeepChannel,
title={DeepChannel: Salience Estimation by Contrastive Learning for Extractive Document Summarization},
author={Jiaxin Shi, Chen Liang, Lei Hou, Juanzi Li, Zhiyuan Liu, Hanwang Zhang},
booktitle = {AAAI},
year = {2019}
}

Requirements

  • python==3.6
  • pytorch==1.0.0
  • spacy
  • nltk
  • pyrouge & rouge

Preprocessing

Before training the model, please follow the instructions below to prepare all the data needed for the experiments.

GLOVE

Please download the GloVe 300d pretrained vector, which is used for word embeddding initialization in all experiments.

CNN-Daily

  1. Download the CNN-Daily story corpus.
  2. Preprocess the original CNN-Daily story corpus and generate the data file:
cd dataset
python process.py --glove </path/to/the/pickle/file> --data cnn+dailymail --data-dir </path/to/the/corpus> --save-path </path/to/the/output/file> --max-word-num MAX_WORD_NUM

The output file will be used in the data loader when training or testing. To reproduce state-of-the-art result, please use the 300d glove file and use the default max-word-num

DUC2007

  1. Download the DUC2007 corpus.
  2. Preprocess the original DUC2007 corpus and generate the data file:
cd dataset
python process.py --glove </path/to/the/pickle/file> --data duc2007 --data-dir </path/to/the/corpus> --save-path </path/to/the/output/file> 

The output file will be used in testing.

pyrouge

We modified the original python wrapper of ROUGE-1.5.5, fixing some errors and rewriting its interfaces in a more friendly way. To accelerate the training process and alleviate the freqrent IO operation of ROUGE-1.5.5, we pre-calculate the rouge attention matrix of every document-summary pair. Please use the following command to accomplish this step:

python offline_pyrouge.py --data-path </path/to/the/processed/data> --save-path </path/to/the/output/file> 

Train

You can simply use the command below to train the DeepChannel model with the default hyperparameters:

python train.py --data-path </path/to/the/processed/data> --save-dir </path/to/save/the/model> --offline-pyrouge-index-json </path/to/the/offline/pyrouge/file>

You can also try training the model with different hyperparameters:

python train.py --data-path </path/to/the/processed/data> --save-dir </path/to/save/the/model> --offline-pyrouge-index-json </path/to/the/offline/pyrouge/file> --SE-type SE_TYPE --word-dim WORD_DIM --hidden-dim HIDDEN_DIM --dropout DROPOUT --margin MARGIN --lr LR --optimizer OPT ...

For detailed information about all the hyperparameters, please run the command:

python train.py --help

We implement three sentence embedding strategies: GRU, Bi-GRU and average, which can be specified by the argument --SE-type. If you want to train the model with the reduced dataset, please specify the --fraction argument.

Test

You can run summarize.py to apply the greedy extraction procedure on test set as well as evaluating the performance on it. Please ensure the hyperparameters in test step is consistent with the ones in traing step. For comparision, we implement some different extracting strategies, which can be specified by the argument --method. Typically, you can directly run the following command for a basic evaluation.

python summarize.py --data-path </path/to/the/processed/data> --save-dir </path/to/the/saved/model> 

Acknowledgement

We refer to some codes of these repos:

Appreciate for their great contributions!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].