pytorch-flask-deploy-webapp
pytorch-flask-deploy-webapp copied to clipboard
This is a Flask + Docker deployment of the PyTorch-based Named Entity Recognition (NER) Model (BiLSTM-CRF) in the Medical AI.
MedicalNER: Deploy PyTorch NER Model with Flask and Docker as Web App
A pretty and customizable web app to deploy your Deep Learning (DL) model with ease
Notice
This repo was to deploy any kind of ML or DL model(s) rather than just NER model.
Usage Demo
-
Clone the repo
$ git clone https://github.com/SuperBruceJia/pytorch-flask-deploy-webapp.git
-
Run the following instructions
1). Build Docker Image
$ docker build -t ner-model .
2). Make and Run a container for the above Image
$ docker run -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -it --rm -d -p 8000:8000 ner-model or $ docker run -d -p 8000:8000 ner-model
-
Open the following URL (Google Chrome is recommended)
http://0.0.0.0:8000/apidocs/#!/default/get_predict or http://0.0.0.0:8000/apidocs
-
Input a medical sentence (in Chinese) and see the recognized entities!
🏆 Enjoy your journey!
Docker Image
The Docker Images have been uploaded to Docker Hub.
Size of the Docker Image
-
Anaconda Python Environment --> 2.22 GB (V1.0)
Used Image: continuumio/anaconda3:4.4.0
-
Standard Python Environment --> 617.96 MB (V2.0)
Used Image: Python:3
-
Smaller Python Environment --> 447.05 MB (V4.0)
Used Image: python:3.8-slim-buster with Apache 2
-
Much Smaller Python Environment --> 169.02 MB (V5.0)
Used Image: python:3.8-slim-buster without Apache 2
Reference Image and Readings
License
MIT License