Contribute Media
A thank you to everyone who makes this possible: Read More

Train. Serve. Deploy! Story of a NLP Model ft. PyTorch, Docker, Uwsgi and Nginx


Quickly prototype a machine translation model from scratch and learn how to serve it in production

Natural language processing has seen leaps of technology progress with Machine Learning becoming the norm of solving the major problems in this area, with Machine translation being one of the major problems in this area. Neural machine translation systems are now used to convert sentences or phrases from one language to another, or in general, for sequence to sequence modeling. In this talk, we’ll be covering the steps from scratch to preprocess, train and serve a NMT model using PyTorch. While building a highly accurate model is a prerequisite to getting good quality translations, often in industry, we also need to make sure we can serve the model to customers without getting timeouts or delays. The practice of serving models requires creating a web app to get client requests and process them in a way the model would understand. For this, we’ll use the various components of the application server environment - Flask, Docker, uwsgi and nginx. This talk is suitable for audience who is working in general with ML models and want to learn how to serve them or working specifically with NMT and want to learn about some quick prototyping tips.

Prerequisites: Audience should be comfortable with the basic ML terminology and procedure of training models. NLP knowledge will be good, but is not a necessity as the focus will be on quick prototyping in production.

By the end of the talk, the audience will have: - Learnt how to preprocess data for NLP systems - Learnt how to quickly prototype and train a translation model - Learnt how to create a web app for the NLP model using Flask - Learnt how to containerize a pytorch model using Docker - Learnt how to serve the model as an app using uwsgi, nginx and


  • Introduction to translation systems, machine translation framework

ML Modelling - Preprocessing data - Training - Generating new translations

Serving and prototyping - Flask app - Docker container - Nginx + uwsgi + supervisord configurations - Putting it all together

Good practices Q/A (optional?)

Improve this page