Skip to content

Simple approach to fetch certain info from the text, provided to it and integration with the docker.

Notifications You must be signed in to change notification settings

Rishabbh-Sahu/text_preprocessing_docker_implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text pre-processing implemented with docker container

A simplest illustration of deploying any model (or a rule based engine in this scenario) using docker container. The main focus of this repo is to leverage Docker Images & containers to run/host the solution anywhere. This repo can be thought of as a first building block of a "production grade system" with services hosted on a cloud. Here, a text pre-processing method(can be considered as an ML model) is used, to filter only alphanumeric characters within the input text, for the simplicity and deployed the docker-image with necessary system/libraries dependencies using docker-container.

Steps

  • Build the docker image (specify a different tag to improve readability -t <tag_name>)
docker build -t flask-rest-api .
  • You can check and verify the docker image using images params.
docker images
  • Run the docker image. Worth to note the mapping of the ports from 5000-local to 5000-docker
docker run -d -p 5000:5000 flask-rest-api
  • To see that the container is in fact running:
docker ps -a
  • Run unit-test using docker
docker run flask-rest-api py.test
  • To show all the logs for the container
docker logs <CONTAINER ID OR CONTAINER NAME>
  • Stop docker container
docker stop

For more docker related commands, follow the link below

https://docs.docker.com/reference/

Requesting to the API

curl --location --request POST 'http://0.0.0.0:5000/fetch' --header 'Content-Type: application/json' --data-raw '{"text": "what7%$$"}'

About

Simple approach to fetch certain info from the text, provided to it and integration with the docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published