Coder Social home page Coder Social logo

rishabbh-sahu / text_preprocessing_docker_implementation Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 55 KB

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

Dockerfile 7.95% Python 92.05%
dockerfile docker-container docker-image containerization text-preprocessing regex-pattern pytest unittest

text_preprocessing_docker_implementation's Introduction

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%$$"}'

text_preprocessing_docker_implementation's People

Contributors

rishabbh-sahu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.