Giter Club home page Giter Club logo

presumm's Introduction

Paper: Advances of Transformer-Based Models for News Headline Generation

Most of the code is taken from authors of BertSumAbs: https://github.com/nlpyang/PreSumm

Scripts for mBART and dataset splits are available here: https://github.com/IlyaGusev/summarus

Below are the scripts for BertSumAbs

Trained models

BertSumAbs checkpoint: https://yadi.sk/d/2jcjmdEXp0EX-Q

Data Preprocessing

As a pretrained BERT we use RuBERT from DeepPavlov: http://docs.deeppavlov.ai/en/master/features/models/bert.html

python3 convert_to_presumm.py --config-path readers/configs/ria_reader_config.json --file-path ~/dataset/ria/ria.shuffled.train.json --save-path ~/dataset/ria_bert/train.bert.pt --bert-path ~/models/rubert_cased_L-12_H-768_A-12_pt

python3 convert_to_presumm.py --config-path readers/configs/ria_reader_config.json --file-path ~/dataset/ria/ria.shuffled.val.json --save-path ~/dataset/ria_bert/test.bert.pt --bert-path ~/models/rubert_cased_L-12_H-768_A-12_pt

Model Training

python3 train.py -task abs -mode train -bert_data_path ~/dataset/ria_bert/ -visible_gpus 0 -dec_dropout 0.2 -model_path ~/models/rubert_cased_L-12_H-768_A-12_pt -sep_optim true -lr_bert 0.002 -lr_dec 0.2 -save_checkpoint_steps 5000 -batch_size 8 -train_steps 200000 -report_every 400 -accum_count 95 -use_bert_emb true -use_interval true -warmup_steps_bert 20000 -warmup_steps_dec 10000 -max_pos 256 -log_file ../logs/abs_bert_ria

Predicting

python3 train.py -task abs -mode validate -batch_size 12 -visible_gpus 0 -test_batch_size 12 -bert_data_path ~/dataset/ria_bert/ -log_file ../logs/val_abs_bert_ria -model_path ~/models/rubert_cased_L-12_H-768_A-12_pt/ -sep_optim true -use_interval true -max_pos 256 -max_length 90 -alpha 0.95 -min_length 8 -result_path ../results/

Evaluating

python3 src/eval_results.py results/ria_40k.40000.gold results/ria_40k.40000.candidate

presumm's People

Contributors

leshanbog avatar nlpyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.