All Projects → abrazinskas → FewSum

abrazinskas / FewSum

Licence: MIT license
Few-shot learning framework for opinion summarization published at EMNLP 2020.

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to FewSum

Copycat-abstractive-opinion-summarizer
ACL 2020 Unsupervised Opinion Summarization as Copycat-Review Generation
Stars: ✭ 76 (+162.07%)
Mutual labels:  summarization, opinion-summarization
PlanSum
[AAAI2021] Unsupervised Opinion Summarization with Content Planning
Stars: ✭ 25 (-13.79%)
Mutual labels:  summarization, opinion-summarization
Summarization Papers
Summarization Papers
Stars: ✭ 238 (+720.69%)
Mutual labels:  summarization
TR-TPBS
A Dataset for Thai Text Summarization with over 310K articles.
Stars: ✭ 25 (-13.79%)
Mutual labels:  summarization
DeepChannel
The pytorch implementation of paper "DeepChannel: Salience Estimation by Contrastive Learning for Extractive Document Summarization"
Stars: ✭ 24 (-17.24%)
Mutual labels:  summarization
ConDigSum
Code for EMNLP 2021 paper "Topic-Aware Contrastive Learning for Abstractive Dialogue Summarization"
Stars: ✭ 62 (+113.79%)
Mutual labels:  summarization
TitleStylist
Source code for our "TitleStylist" paper at ACL 2020
Stars: ✭ 72 (+148.28%)
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 (+679.31%)
Mutual labels:  summarization
struct infused summ
(COLING'18) The source code for the paper "Structure-Infused Copy Mechanisms for Abstractive Summarization".
Stars: ✭ 29 (+0%)
Mutual labels:  summarization
factsumm
FactSumm: Factual Consistency Scorer for Abstractive Summarization
Stars: ✭ 83 (+186.21%)
Mutual labels:  summarization
hf-experiments
Experiments with Hugging Face 🔬 🤗
Stars: ✭ 37 (+27.59%)
Mutual labels:  summarization
Machine-Learning-Notes
Lecture Notes of Andrew Ng's Machine Learning Course
Stars: ✭ 60 (+106.9%)
Mutual labels:  summarization
pn-summary
A well-structured summarization dataset for the Persian language!
Stars: ✭ 29 (+0%)
Mutual labels:  summarization
teanaps
자연어 처리와 텍스트 분석을 위한 오픈소스 파이썬 라이브러리 입니다.
Stars: ✭ 91 (+213.79%)
Mutual labels:  summarization
SRB
Code for "Improving Semantic Relevance for Sequence-to-Sequence Learning of Chinese Social Media Text Summarization"
Stars: ✭ 41 (+41.38%)
Mutual labels:  summarization
frame
Notetaking Electron app that can answer your questions and makes summaries for you
Stars: ✭ 88 (+203.45%)
Mutual labels:  summarization
Sumy
Module for automatic summarization of text documents and HTML pages.
Stars: ✭ 2,705 (+9227.59%)
Mutual labels:  summarization
FocusSeq2Seq
[EMNLP 2019] Mixture Content Selection for Diverse Sequence Generation (Question Generation / Abstractive Summarization)
Stars: ✭ 109 (+275.86%)
Mutual labels:  summarization
BillSum
US Bill Summarization Corpus
Stars: ✭ 31 (+6.9%)
Mutual labels:  summarization
seq3
Source code for the NAACL 2019 paper "SEQ^3: Differentiable Sequence-to-Sequence-to-Sequence Autoencoder for Unsupervised Abstractive Sentence Compression"
Stars: ✭ 121 (+317.24%)
Mutual labels:  summarization

Few-Shot Learning for Opinion Summarization

This repository contains the codebase along with accompanying artifacts of the corresponding work published at EMNLP 2020, Dominican Republic.

Installation

The easiest way to proceed is to create a separate conda environment.

conda create -n fewsum python=3.7.5
conda activate fewsum

Install required modules.

pip install -r requirements.txt

Add the root directory to the path if you want to execute scripts from the command line.

export PYTHONPATH=root_path:$PYTHONPATH

Data

Training data

Data pre-processing pipeline along with instructions is available from the previous project. Further, reviews needs to be enriched with ROUGE scores (coverage property) in the leave-one-out fashion using fewsum/scripts/postprocess_data.py. This is done to avoid online ROUGE computations that are time consuming.

We also provide the final pre-processed dataset versions, both for Amazon and Yelp. Unzip them to artifacts/[yelp or amazon]/. These datasets can be directly used to train the model.

Annotated summaries

For the purpose of fine-tuning and evaluation, we produced Yelp and Amazon annotated datasets. More information found in the corresponding readme file.

Running the model

In order to arrive to the final model, a number of steps need to be executed as described below. For each step, we provided checkpoints that can be used to generate summaries and also used as starting points for downstream steps.

In general, model hyper-parameters can modified by altering corresponding classes in fewsum/config/model_hp. In the same vein, one can modify the run configuration of each model in fewsum/config/run/ classes.

The fewsum/workflow.py is the main file for training and inference that has logic for assembling data pipelines, tokenizers, and other relevant components. Unless a custom setup is required, no modifications of this file is needed.

Preparation

We provide checkpoints for each step for Amazon, which can be downloaded by following links in each section below. Checkpoints need to be placed to artifacts/amazon/checkpoints/. If you use a different path, specify it in a run configuration file, e.g., fewsum/config/model_hp/unsup_run.py.

We also provide the word vocabulary, BPE vocabularies, and a true caser in artifacts/amazon/misc. These can be produced for custom datasets using scripts available in fewsum/scripts.

Unsupervised pre-training

Here, we use the leave-one-out objective in order to pre-train the model on unannotated reviews using the command below; checkpoint.

python fewsum/workflow.py --regime=unsupervised

Novelty reduction

At this stage, we reduce the novelty by penalizing output probability assignments to words that do not appear in the input reviews; checkpoint.

python fewsum/workflow.py --regime=novelty_reduction

Plug-in network initialization

Here, the plug-in network is added that is trained to predict property values for reviews (derived by the oracle) based on the leave-one-out setting; checkpoint.

python fewsum/workflow.py --regime=plugin_init

Plug-in network tuning

In this phase, we utilize human-written abstractive summaries and tune the plug-in network to predict their property values that are derived by the oracle; checkpoint.

python fewsum/workflow.py --regime=plugin_tuning

Joint-tuning

This is the final phase, where we fine-tune both the plug-in network and the attention mechanism over the encoder states; checkpoint.

python fewsum/workflow.py --regime=joint_tuning

Summary generation

In order to generate summaries at any stage, please replace the REGIME token in the command below.

python fewsum/workflow.py --regime=REGIME --inference

Already generated summaries by the final model are also available.

Citation

@inproceedings{brazinskas2020few,
  title={Few-Shot Learning for Opinion Summarization},
  author={Bra{\v{z}}inskas, Arthur and Lapata, Mirella and Titov, Ivan},
 booktitle={Proceedings of the conference on empirical methods in natural language processing (EMNLP)},
  year={2020}
}

License

MIT

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].