GithubHelp home page GithubHelp logo

isabella232 / generating_text_summary_with_gpt2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from as-ideas/generating_text_summary_with_gpt2

0.0 0.0 0.0 12.63 MB

A simple approach to use GPT2-medium (345M) for generating high quality text summaries with minimal training.

Python 31.33% Jupyter Notebook 68.67%

generating_text_summary_with_gpt2's Introduction

Generating Text Summary With GPT2

Accompanying code for blog Generating Text Summaries Using GPT-2 on PyTorch with Minimal Training.

Dataset Preparation

Run max_article_sizes.py for both CNN and Daily Mail Tokenized articles separately. It will create pickle files of sizes of each CNN/DAILY MAIL articles.
$ python max_article_sizes.py path/to/cnn_or_dailymail/tokenized/articles
Run below command to prepare json files which contains tokenized articles and summaries
$ python prepare_data.py path/to/pickle_file/of/articles/sizes/created/using/above/command

Training

Use pretrained weights to finetune the GPT2 model using tricks mentioned in Generating Text Summaries Using GPT-2 on PyTorch with Minimal Training on your data.

$ python train_gpt2_summarizer.py --batch_size 1 --root_dir path/to/json/files/created/using/prepare_data.py

Credit

Sample Efficient Text Summarization Using a Single Pre-Trained Transformer

Urvashi Khandelwal, Kevin Clark, Dan Jurafsky, Lukasz Kaiser

Training code in this repo has been adapted from huggingface run_lm_finetuning.py.

generating_text_summary_with_gpt2's People

Contributors

skrohit avatar

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.