Skip to content

oppiesystems/short-api

Repository files navigation

short-api

Domain-specific content summarization API.

Development

Development Prerequisites

npm run preinstall

--or--

virtualenv .
source bin/activate
pip install -r requirements.txt
python -c 'import nltk; nltk.download("punkt")'

Download models manually (Optional)

# Approximately 3gb download
mkdir models
wget -P ./models http://www.cs.toronto.edu/~rkiros/models/dictionary.txt

Run

npm start

--or--

python main.py

Test

Unit Test

Execute the following command to run the unit test package for the project.

npm test

--or--

python -m unittest -v test # Verbose

API

POST /digest

curl --header "Content-Type: application/json" \
  --request POST \
  -d @test/post_data.json \
  http://0.0.0.0:5900/api/digest

Deployment

Local Docker

Build image

docker build -t breef:latest .

Run image

docker-compose up

Stop the container

Removes volumes when brought down

docker-compose down --volumes

Google Cloud Platform

GCP Prerequisites

gcloud auth configure-docker

Build and deploy GCP image

yarn run deploy

Run the GCP Image

docker run gcr.io/breef-247014/breef-image

Additional Docker Commands

Tail Logs

docker logs -f breef_app

Execute Command in Container

docker exec -t -i breef <COMMAND>

docker exec -t -i breef_app ls models

Mount Remote Models Locally

sudo mkdir -m 777 -p /mnt/models && gcsfuse --foreground -o nonempty breef-models /mnt/models

About

Domain-specific content summarization API (NLP / Skip Thoughts)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published