Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Models to perform neural summarization (extractive and abstractive) using machine learning transformers and a tool to convert abstractive summarization datasets to the extractive task.

License

NotificationsYou must be signed in to change notification settings

HHousen/TransformerSum

Repository files navigation

TransformerSum Logo

TransformerSum

Models to perform neural summarization (extractive and abstractive) using machine learning transformers and a tool to convert abstractive summarization datasets to the extractive task.

GitHub licenseGithub commitsmade-with-pythonDocumentation StatusGitHub issuesGitHub pull-requestsDeepSource

TransformerSum is a library that aims to make it easy totrain,evaluate, anduse machine learningtransformer models that performautomatic summarization. It features tight integration withhuggingface/transformers which enables the easy usage of awide variety of architectures andpre-trained models. There is a heavy emphasis on codereadability andinterpretability so that both beginners and experts can build new components. Both the extractive and abstractive model classes are written usingpytorch_lightning, which handles the PyTorch training loop logic, enablingeasy usage of advanced features such as 16-bit precision, multi-GPU training, andmuch more.TransformerSum supports both the extractive and abstractive summarization oflong sequences (4,096 to 16,384 tokens) using thelongformer (extractive) andLongformerEncoderDecoder (abstractive), which is a combination ofBART (paper) and the longformer.TransformerSum also contains models that can run on resource-limited devices while still maintaining high levels of accuracy. Models are automatically evaluated with theROUGE metric but human tests can be conducted by the user.

Check outthe documentation for usage details.

Features

  • For extractive summarization, compatible with everyhuggingface/transformers transformer encoder model.

  • For abstractive summarization, compatible with everyhuggingface/transformers EncoderDecoder and Seq2Seq model.

  • Currently, 10+ pre-trained extractive models available to summarize text trained on 3 datasets (CNN-DM, WikiHow, and ArXiv-PebMed).

  • Contains pre-trained models that excel at summarization on resource-limited devices: On CNN-DM,mobilebert-uncased-ext-sum achieves about 97% of the performance ofBertSum while containing 4.45 times fewer parameters. It achieves about 94% of the performance ofMatchSum (Zhong et al., 2020), the current extractive state-of-the-art.

  • Contains code to train models that excel at summarizing long sequences: Thelongformer (extractive) andLongformerEncoderDecoder (abstractive) can summarize sequences of lengths up to 4,096 tokens by default, but can be trained to summarize sequences of more than 16k tokens.

  • Integration withhuggingface/nlp means any summarization dataset in thenlp library can be used for both abstractive and extractive training.

  • "Smart batching" (extractive) and trimming (abstractive) support to not perform unnecessary calculations (speeds up training).

  • Use ofpytorch_lightning for code readability.

  • Extensive documentation.

  • Three pooling modes (convert word vectors to sentence embeddings): mean or max of word embeddings in addition to the CLS token.

Pre-trained Models

All pre-trained models (including larger models and other architectures) are located inthe documentation. The below is a fraction of the available models.

Extractive

NameDatasetCommentsR1/R2/RL/RL-SumModel DownloadData Download
mobilebert-uncased-ext-sumCNN/DMNone42.01/19.31/26.89/38.53ModelCNN/DM Bert Uncased
distilroberta-base-ext-sumCNN/DMNone42.87/20.02/27.46/39.31ModelCNN/DM Roberta
roberta-base-ext-sumCNN/DMNone43.24/20.36/27.64/39.65ModelCNN/DM Roberta
mobilebert-uncased-ext-sumWikiHowNone30.72/8.78/19.18/28.59ModelWikiHow Bert Uncased
distilroberta-base-ext-sumWikiHowNone31.07/8.96/19.34/28.95ModelWikiHow Roberta
roberta-base-ext-sumWikiHowNone31.26/09.09/19.47/29.14ModelWikiHow Roberta
mobilebert-uncased-ext-sumarXiv-PubMedNone33.97/11.74/19.63/30.19ModelarXiv-PubMed Bert Uncased
distilroberta-base-ext-sumarXiv-PubMedNone34.70/12.16/19.52/30.82ModelarXiv-PubMed Roberta
roberta-base-ext-sumarXiv-PubMedNone34.81/12.26/19.65/30.91ModelarXiv-PubMed Roberta

Abstractive

NameDatasetCommentsModel Download
longformer-encdec-8192-bart-large-abs-sumarXiv-PubMedNoneNot yet...

Install

Installation is made easy due to conda environments. Simply run this command from the root project directory:conda env create --file environment.yml and conda will create and environment calledtransformersum with all the required packages fromenvironment.yml. The spacyen_core_web_sm model is required for theconvert_to_extractive.py script to detect sentence boundaries.

Step-by-Step Instructions

  1. Clone this repository:git clone https://github.com/HHousen/transformersum.git.
  2. Change to project directory:cd transformersum.
  3. Run installation command:conda env create --file environment.yml.
  4. (Optional) If using theconvert_to_extractive.py script then download theen_core_web_sm spacy model:python -m spacy download en_core_web_sm.

Meta

ForTheBadge built-with-love

Hayden Housen –haydenhousen.com

Distributed under the GNU General Public License v3.0. See theLICENSE for more information.

https://github.com/HHousen

Attributions

Contributing

All Pull Requests are greatly welcomed.

Questions? Commends? Issues? Don't hesitate to open anissue and briefly describe what you are experiencing (with any error logs if necessary). Thanks.

  1. Fork it (https://github.com/HHousen/TransformerSum/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

About

Models to perform neural summarization (extractive and abstractive) using machine learning transformers and a tool to convert abstractive summarization datasets to the extractive task.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp