Skip to content

vivekpatani/text-summarizer

Repository files navigation

Python Wrapper Around CoreNLP along with Text Summarizer

This is a simple text summarizer using a sentencer, depenency parser and reconstructor.

Stack Used

  • Python 3.5
  • Docker
  • MariaDB

Prerequisites - Please follow instructions

For Windows (Untested)

For MacOS

  • Install Docker - https://docs.docker.com/docker-for-mac/
  • From Project Root - cd corenlp-server and get Stanford CoreNLP Server by executing- ./get-corenlp.sh
  • From Project Root - cd corenlp-server and Execute docker build -t corenlp-server .
  • This ensures that the docker container is now created.

For Linux (Tested on Ubuntu only)

  • From Project Root - cd corenlp-server and get Stanford CoreNLP Server by executing - ./get-corenlp.sh
  • Docker - curl -sSL https://get.docker.com/ | sh -y
  • Give docker local user rights - sudo usermod -aG docker $USER
  • Reboot Computer
  • From Project Root - cd corenlp-server and Execute docker build -t corenlp-server .
  • This ensures that the docker container is now created.

One Time Setup

  • Rename config-sample.json to config.json
  • Change the configuration for MariaDB as per your computer
  • Create a new database (by default it is called text_summarization).
  • If you for some reason change the default name, change it in script.py as well.

How to Initialise server

  • From Project Root - python init-server.py

How to Terminate Server

  • From Project Root - python terminate-server.py

Usage

  • First Initialise Server.
  • Please Edit script.py according to your requirements:
    • Execute - script.py to give it a run.
    • To change input, edit input/input.txt
  • Once done with summarization make sure to terminate server.

For errors

  • Check output.log

Todo

  • Stats
  • Templating

Tested on

  • Elementary OS (Ubuntu 16.04.02)

Quirks

  • If for some reason Docker container such as rejecting requests and acts weird Terminate Server and Reinitialise it!

Acknowledgements