Skip to content

guokr/Brief

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brief

Brief is a text summarizer based on sequence to sequence framework, implemented in Python and Facebook's PyTorch project. In a nutshell, this is Brief.

Pypi package GitHub release GitHub issues Travis CI

DemoRequirementsInstallPre-trained modelsTrainExamplesDocument

Quick demo

from brief import BriefModel
model = BriefModel("./checkpoint_transformer")

long_text = ("                                                                                         。")
             
model.summarize([long_text])
>>>                    long_text = ("                             访                                                   。")
              
model.summarize([long_text])
>>>                

Requirements

  • PyTorch
  • tqdm
  • torchtext
  • dill
  • numpy
  • Python3

Install

$ pip install brief --user

Did you guys have some pre-trained models

Yes, we will release two pre-trained models on LCSTS dataset on word-level and char-level separately.

How to train on your own dataset

python3 train.py --train_filename train_full.tsv 
                 --valid_filename valid_full.tsv
                 --checkpoint_dir /data_hdd/brief_dev/checkpoint_exp
                 --epoch 10
                 --batch_size 128

More examples

Updating...

Releases

No releases published

Packages

No packages published

Languages