Skip to content

Quan25/flask-summary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Summary

** PreSumm modules was originally from https://github.com/nlpyang/PreSumm **

Features

  • generate summary on given text

Train and Use the model generate by BertSum

please follow this documents about how to train and use the model generated by BertSum

Installation In A Nutshell (on localhost)

  1. clone this project to your local disk
 git clone https://github.com/Quan25/flask-summary.git
  1. cd into the cloned project and download PreSumm
 git clone https://github.com/nlpyang/PreSumm.git
  1. cd into PreSumm folder and change the branch to dev
 git checkout dev
  1. Install Flask
  2. Install ROUGE-1.5.5
  • Install libxml-parser-perl, it is essential for installing ROUGE-1.5.5
  sudo apt-get install libxml-parser-perl
  • and make sure you can run this, which means the ROUGE is successfully installed
  ./runROUGE-test.pl
  1. Install pyrouge
 git clone https://github.com/bheinzerling/pyrouge.git
 cd pyrouge
 pip install -e .
  • Additional information can be found here about how to install pyrouge and running the test
  1. Please install pytorch 1.1.0 with this comand
  • GPU
  conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
  • CPU Only
  conda install pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly -c pytorch
  1. put your model file(i.e. xxxxx.pt) inside /PreSumm/models
  2. add the following PYTHONPATH to bash_profile
 export PYTHONPATH=$PYTHONPATH:/path/to/flask-summary/PreSumm/src
 export PYTHONPATH=$PYTHONPATH:/path/to/flask-summary/PreSumm/

  1. run source ~/.bash_profile
  2. Run python app.py in the flask-summary directory.
  3. Start web server by running python app.py while in the server_example directory.
  4. Browse the examples at 0.0.0.0:5000 using a browser. (defaults to port 5000)

About

a python flask web-app using Bert to do summarization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages