Webinar:
Fine-tune and deploy
Hugging Face NLP models
BastienVerdebout
Product Manager @ OVHcloud
https://twitter.com/BastienOvh
AbhishekThakur
Data scientist @ Hugging Face
https://twitter.com/abhi1thakur
Stay tuned, we’ll be getting started very soon!
Submit your
questions using the
‘questions’ tab
under Chat.
Follow us & tweet
the session
@OVHcloud
The recording will
be sent after
today’s session
Email us at
event@ovhcloud.com
Housekeeping
3
 Hugging Face ? NLP ?
 Fine-Tuning
 Demo : Fine-tuning
 Demo : Deployment in production
 Sum-up
Agenda
Webinar : fine-tune and deploy Hugging Face NLP models
Hugging Face
On a mission to solve NLP,
one commit at a time.
www.HuggingFace.co
Hugging Face is the most popular open source Natural Language Processing (NLP) library !
• Community model hub with more than 4,000 models
• More than 3To of models stored in the cloud
• More than 5 new models uploaded each day
• Founded in 2016
• 20+ employees
Natural Language Processing : the concept
Natural Language Processing
Models
Understand what is being
said/written
Determine the right answer Give an answer
humanly-readable
NLP is broadly defined as the automatic manipulation of natural language,
like speech and text, by software. It’s a subset of artificial intelligence.
How do I say « Hello ! »
in Spanish ?
Output : « Hola! »
Natural Language Understanding Machine Learning Natural Language Generation
Let’s use NLP pre-trained models !
Use-case example #1 : sentiment analysis
Code sample
Use-cases
Analyze emails, product reviews, tweets, ... Then react :
 Brand : monitor your brand reputation on social medias
 E-commerce : remove bad products, highlight good ones
 Support team : priorize negative emails
 …
Use-case example #2 : question answering
Code sample
Use-cases
You can drastically improve user experience :
 Website : contextual « search engines »
 Internal documentation : easier to find what you need
 Voice Assistants (« Alexa, … » )
 …
.. And much more !
Use-cases
 Text Analysis : detect fake news, detect spams and scams, …
 Text Generation : better video games, better AI assistants, SEO, …
 Text Summarization : auto generated excerpts for products, for webpages,
for SEO, …
https://huggingface.co/openai-detectorhttps://transformer.huggingface.co
Text generation Fake detector
Fine-tuning
Why and how
with Abhishek Thakur
Fine-tuning Transformer
Models
Abhishek Thakur
Translation
Sentiment
Classification
Chatbots / VAs
Autocomplete
Entity Extraction
Question
Answering
Review Rating
Prediction
Search Engine Speech to Text
Topic Extraction
Applications of natural language processing
Why fine tune?
Fine-tuning often gives good results
Pretrained
model
Adaptation
Head
Tokenizer
Transfer Learning for text classification
17
Jim Henson was a
puppeteer
Jim
Hens
on
was
a
Tokenization
1106
7
5567
245
120
1.2 2.7 0.6 -0.2
3.7 9.1 -2.1 3.1
1.5 -4.7 2.4 6.7
6.1 2.4 7.3 -0.6
-3.1 2.5 1.9 -0.1
0.7 2.1 4.2 -3.1
Classifi
er
model
Convert
to
vocabula
ry
indices
Pretraine
d
model
Tru
e
0.78
86
Fals
e
-
0.22
3
via Thomas Wolf
A – Transfer Learning for text classification
18
Remarks:
❏ The error rate goes down quickly! After one epoch we already have >90% accuracy.
⇨ Fine-tuning is highly data efficient in Transfer Learning
❏ We took our pre-training & fine-tuning hyper-parameters straight from the literature on
related models.
⇨ Fine-tuning is often robust to the exact choice of hyper-parameters
via Thomas Wolf
Transformers library
We’ve built an opinionated framework providing state-of-the-art general-purpose tools for Natural Language
Understanding and Generation.
Features:
 Super easy to use – fast to on-board
 For everyone – NLP researchers, practitioners, educators
 State-of-the-Art performances – on both NLU and NLG tasks
 Reduce costs/footprint – 30+ pretrained models in 100+ languages
 Deep interoperability between TensorFlow 2.0 and PyTorch
Live demo
Hugging Face model fine-tuning
via OVHcloud AI Training
AI Training : demo video
ML Serving : demo video
Sum-up !
Bastien
Sum-up !
1 NLP is fun and useful. Even more since Hugging Face is here
2
It’s community based. Don’t hesitate to contribute !
More info : https://huggingface.co/transformers/contributing.html
3
OVHcloud now provides all required tools for your AI workflows.
From Storage to Processing to Training to Serving !
Contact-us or browse https://www.ovhcloud.com/en/public-cloud/ai-solutions/
100€ voucher on OVHcloud
For Training / Serving / Storage / …
You’ll receive it via email this week
Try it by yourself ! Santa is here
Image credit to coil.com
 50 hours of GPU training
(1,75€ /GPU V100s /hour )
 12 months of Model Serving (1 node)
 10TB of data in Object Storage (1 month)
2626
Thank you! Open for
questions
twitter.com/ovhcloud
facebook.com/ovhcloud
OVHcloud
twitter.com/huggingface
twitter.com/abhi1thakur

Fine tune and deploy Hugging Face NLP models

  • 1.
    Webinar: Fine-tune and deploy HuggingFace NLP models BastienVerdebout Product Manager @ OVHcloud https://twitter.com/BastienOvh AbhishekThakur Data scientist @ Hugging Face https://twitter.com/abhi1thakur Stay tuned, we’ll be getting started very soon!
  • 2.
    Submit your questions usingthe ‘questions’ tab under Chat. Follow us & tweet the session @OVHcloud The recording will be sent after today’s session Email us at event@ovhcloud.com Housekeeping
  • 3.
    3  Hugging Face? NLP ?  Fine-Tuning  Demo : Fine-tuning  Demo : Deployment in production  Sum-up Agenda Webinar : fine-tune and deploy Hugging Face NLP models
  • 4.
    Hugging Face On amission to solve NLP, one commit at a time.
  • 5.
    www.HuggingFace.co Hugging Face isthe most popular open source Natural Language Processing (NLP) library ! • Community model hub with more than 4,000 models • More than 3To of models stored in the cloud • More than 5 new models uploaded each day • Founded in 2016 • 20+ employees
  • 6.
    Natural Language Processing: the concept Natural Language Processing Models Understand what is being said/written Determine the right answer Give an answer humanly-readable NLP is broadly defined as the automatic manipulation of natural language, like speech and text, by software. It’s a subset of artificial intelligence. How do I say « Hello ! » in Spanish ? Output : « Hola! » Natural Language Understanding Machine Learning Natural Language Generation
  • 7.
    Let’s use NLPpre-trained models !
  • 8.
    Use-case example #1: sentiment analysis Code sample Use-cases Analyze emails, product reviews, tweets, ... Then react :  Brand : monitor your brand reputation on social medias  E-commerce : remove bad products, highlight good ones  Support team : priorize negative emails  …
  • 9.
    Use-case example #2: question answering Code sample Use-cases You can drastically improve user experience :  Website : contextual « search engines »  Internal documentation : easier to find what you need  Voice Assistants (« Alexa, … » )  …
  • 10.
    .. And muchmore ! Use-cases  Text Analysis : detect fake news, detect spams and scams, …  Text Generation : better video games, better AI assistants, SEO, …  Text Summarization : auto generated excerpts for products, for webpages, for SEO, … https://huggingface.co/openai-detectorhttps://transformer.huggingface.co Text generation Fake detector
  • 11.
  • 12.
  • 13.
    Translation Sentiment Classification Chatbots / VAs Autocomplete EntityExtraction Question Answering Review Rating Prediction Search Engine Speech to Text Topic Extraction Applications of natural language processing
  • 15.
  • 16.
  • 17.
    Pretrained model Adaptation Head Tokenizer Transfer Learning fortext classification 17 Jim Henson was a puppeteer Jim Hens on was a Tokenization 1106 7 5567 245 120 1.2 2.7 0.6 -0.2 3.7 9.1 -2.1 3.1 1.5 -4.7 2.4 6.7 6.1 2.4 7.3 -0.6 -3.1 2.5 1.9 -0.1 0.7 2.1 4.2 -3.1 Classifi er model Convert to vocabula ry indices Pretraine d model Tru e 0.78 86 Fals e - 0.22 3 via Thomas Wolf
  • 18.
    A – TransferLearning for text classification 18 Remarks: ❏ The error rate goes down quickly! After one epoch we already have >90% accuracy. ⇨ Fine-tuning is highly data efficient in Transfer Learning ❏ We took our pre-training & fine-tuning hyper-parameters straight from the literature on related models. ⇨ Fine-tuning is often robust to the exact choice of hyper-parameters via Thomas Wolf
  • 19.
    Transformers library We’ve builtan opinionated framework providing state-of-the-art general-purpose tools for Natural Language Understanding and Generation. Features:  Super easy to use – fast to on-board  For everyone – NLP researchers, practitioners, educators  State-of-the-Art performances – on both NLU and NLG tasks  Reduce costs/footprint – 30+ pretrained models in 100+ languages  Deep interoperability between TensorFlow 2.0 and PyTorch
  • 20.
    Live demo Hugging Facemodel fine-tuning via OVHcloud AI Training
  • 21.
    AI Training :demo video
  • 22.
    ML Serving :demo video
  • 23.
  • 24.
    Sum-up ! 1 NLPis fun and useful. Even more since Hugging Face is here 2 It’s community based. Don’t hesitate to contribute ! More info : https://huggingface.co/transformers/contributing.html 3 OVHcloud now provides all required tools for your AI workflows. From Storage to Processing to Training to Serving ! Contact-us or browse https://www.ovhcloud.com/en/public-cloud/ai-solutions/
  • 25.
    100€ voucher onOVHcloud For Training / Serving / Storage / … You’ll receive it via email this week Try it by yourself ! Santa is here Image credit to coil.com  50 hours of GPU training (1,75€ /GPU V100s /hour )  12 months of Model Serving (1 node)  10TB of data in Object Storage (1 month)
  • 26.
    2626 Thank you! Openfor questions twitter.com/ovhcloud facebook.com/ovhcloud OVHcloud twitter.com/huggingface twitter.com/abhi1thakur

Editor's Notes

  • #2 Introduction: John Digby, presales at OVHcloud for 8 months, with a technical background in Virtualisation, Storage and general infrastructure. Introduction: Bradley Harrad, Product Marketing Manager for the Northern Europe cluster for 4 months, 10 years experience in marketing and strategic alliance partnerships, taking product to market, communicating solutions clearly and engaging with customers to help develop the market.
  • #3 Before we begin, I’d like to go over a few housekeeping points. Throughout the webinar, you can submit your questions to us. You can see on the control panel the questions tab. If you pop your questions in there, we’ll have some time at the end to dig into them. If you have any other issues with sound or visuals please let us know through the chat function as well. If you want to follow us on social media we are on Twitter, at OVHcloud_UK. We will also be recording today’s session. And at the end of the webinar we will send out a recording of the presentations. So you’ll get that via the email address you registered with us. And finally, if you have any other questions, you can email those to us at event@ovhcloud.com.
  • #4 I will start by giving you a quick overview of OVHcloud. 1. Who we are OVHcloud are and the businesses evolution after 20 years. Bradley Harrad 2. From Cloud-ready to business-ready – Overcoming challenges during cloud transformation, importance of multi-cloud strategy, and how OVHcloud can provide multiple solutions, Ensuring success. Bradley Harrad 3. Data Sovereignty and how OVHcloud positions for GDPR, the cloud act, etc… Bradley Harrad 4. Total cost of ownership of On-prem versus private cloud/Software defined Data Centre at OVHcloud John Digby 5. Three scenarios about how current OVHcloud customers consume OVHcloud Software Defined Data Centre in the form of Datacentre Replacement, Disaster Recovery and Datacentre extension John Digby