axenov / LocalBertSummarization

:boom: Abstractive Text Summarization with Bert and Convolution :alien:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neural-based Abstractive Text Summarization

This system implements the abstractive text summarization models from the paper Abstractive Text Summarization based on Language Model Conditioning and Locality Modeling .

The system supports two neural models:

  • BERT-Transformer (bert) - the model using pre-trained BERT to condition the encoder and decoder of Transformer.
  • Transformer with Convolutional Self-Attention (conv) - the model replacing self-attention with convolutional self-attention to better model local dependencies.

For summarization of long texts, the TF-IDF extractive summarizer can be used before the abstractive models.

Usage

First, download the models from here and extract them in the models/ folder.

Then, run the system specifyning the language of the text (English and German), the method of summarization and if the extractive summarizer must be used before the abstractive one.

The example of usage:

from summarizer import AbstractiveSummarizer
texts = []
with open("data/sample_en.txt") as f:
	texts = [text for text in f]

model = AbstractiveSummarizer(language = 'en', method = 'conv', extract = True)
for summ in model.summarize(texts):
	print(summ)

About

:boom: Abstractive Text Summarization with Bert and Convolution :alien:

License:MIT License


Languages

Language:Python 88.5%Language:Perl 4.7%Language:Shell 3.7%Language:Emacs Lisp 2.2%Language:Smalltalk 0.2%Language:Ruby 0.2%Language:NewLisp 0.2%Language:JavaScript 0.1%Language:Dockerfile 0.1%Language:Slash 0.0%Language:SystemVerilog 0.0%