Deep Transfer Learning in NLP with Python

Dipanjan Sarkar (~dipanjan)





Handling tough real-world problems in Natural Language Processing (NLP) include tackling the lack of availability of enough labeled data for training and also solving tasks which really require more advanced human cognitive abilities including summarization, translation, comprehension and so on. The idea is no longer to train models from scratch for every new task but to leverage knowledge extracted from models which have been pre-trained on a large number of diverse tasks.

Thanks to the recent advancements in deep transfer learning in NLP, we have been able to make rapid strides in not only tackling these problems but also leverage these models for diverse downstream NLP tasks - which I like to call multi-task NLP. This session will cover concepts, methodologies and some hands-on examples.


In this session we will first look at various state-of-the-art models in deep transfer learning for NLP with hands-on examples in Python including:

  • CNNs \ LSTMs with pre-trained embeddings
  • Universal Sentence Encoders (NNLM \ USE)
  • Transformers (BERT \ DistilBERT)

We will then take a look at true multi-task learning for NLP by leveraging the powerful pipeline construct of the transformers package where we will look at tacking the following tasks with just a few lines of code in Python!

  • Named Entity Recognition
  • Fill in the next word
  • Sentiment Analysis
  • Question & Answering System
  • Text Summarization


Having a background knowledge of Natural Language Processing and Deep Learning helps. This will be an applied-DL \ hands-on session for the most part.

Video URL:

Content URLs:

Slides and Code will be in my GitHub assuming this session pans out:

Sample Deck:

Speaker Info:

Dipanjan (DJ) Sarkar is a Data Science Lead at Applied Materials, leading advanced analytics efforts around computer vision, natural language processing and deep learning. He is also a Google Developer Expert in Machine Learning. He has consulted and worked with several startups as well as Fortune 500 companies like Intel and Open Source organizations like Red Hat \ IBM. He primarily works on leveraging data science, machine learning and deep learning to build large- scale intelligent systems. He holds a master of technology degree with specializations in Data Science and Software Engineering.

Dipanjan has been an analytics practitioner for several years now, specializing in machine learning, natural language processing, computer vision and deep learning. Having a passion for data science and education, he also acts as an AI Consultant and Mentor at various organizations like Springboard, where he helps people build their skills on areas like Data Science and Machine Learning. Dipanjan is also a published author, having authored several books on R, Python, Machine Learning, Social Media Analytics, Natural Language Processing, and Deep Learning. In his spare time he loves reading, gaming, watching popular sitcoms and football and writing interesting articles on and He is also a strong supporter of open-source and publishes his code and analyses from his books and articles on GitHub at

Speaker Links:

  • GitHub:
  • LinkedIn:
  • Past PyCon Talk:
  • Recent Conference Session:

Section: Data Science, Machine Learning and AI
Type: Talks
Target Audience: Intermediate
Last Updated: