A Skeleton Project for Building a simple Dockerized Bottle Application

1. To run locally (without docker) on port 8080:

    Instalation:
    1.1. `pip install -r requirements.txt`
    1.2.  python -m spacy download en_core_web_sm
    1.3. Download embeddings from here:
    https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM/edit?usp=sharing
    Put them into the root folder (do not unpack)

    Try
    1.2. `python server.py 8080`
    1.3. Example:

curl --request POST \
  --url http://0.0.0.0:8080/summarize \
  --header 'Content-Type: application/json' \
  --data '{"comments":["excellent post! i hope our local papers would do this. it is nauseating what locals have said in comments, even if fatal accident announcements. and being on a small island, even “nicknames” after awhile are not anonymous but yet, they still keep writing nasties.", "And don’t tell me that moderation will fix things. We actively employ our bozo filter to ban users and we weed poor comments on our site as much as we can (now we just need to do more moderating, which seems to scare the reporters for the obvious reasons). The flame-wars, off-topic rants (ie, Obama and liberals get blamed for everything under the sun) and other inane commentary just keeps a comin’. You can moderate all you want and things will improve, but it’s slightly delusional to think the garden pests are ever going to leave your crops alone, especially if they’re allowed to continue to camouflage their identities. Aren’t we supposed to be in the business of unmasking things anyway?", "Simply want to say your article is as amazing. The clarity to your put up is just great and that i could think you are knowledgeable in this subject. Fine with your permission allow me to take hold of your feed to keep up to date with drawing close post.", "Maybe, though, no one was ever really serious about that conversation. Maybe the idea was to boost ad impressions with an abundance of verbiage supplied gratis by the readership.", "I see you’ve spoken to someone from Gannett.", "You sure were punchy enough in this posting to give the intended impression that you know something the newspaper industry doesn’t. But your advice still won’t solve the problem. We have nearly a decade of direct empirical evidence that comments generally do not work on Web sites and never work on hard-news stories. Perhaps they work on op-ed pieces, though indeed ante-facto moderation is necessary."], 
 "language":"en", 
 "minimal_sentence_length":5, 
 "summary_length":50}'

2. To run with Docker on port 8080

    2.1. `sudo docker build -t my_test_app .`
    2.2. `sudo docker run -p 8082:8080 my_test_app`

3. Fixing the documentation

    Remember to fix the documentation to match your use of this skeleton. This is
    done in three main places:

    3.1. This README file
    3.2. swagger.yml (see lines 3-5 and 35)
    3.3. server.py (see line 13)

4. Modifying the API

    If the API is modified, the changes need to be reflected to swagger.yml. 

5. Linting, etc.

    The project comes with a bunch of linting (style checking, etc) tools pre-
    configured. You can also manually run the linters with

    $ isort -rc . && black . && flake8 .

    Development becomes easier, if you configure git to automatically run the
    linters whenever you try to commit using a pre-commit hook. You can
    install the relevant pre-commit hooks with `pre-commit install` (with the
    virtual environment loaded).