How Hugging Face Helps Non Technical Users Build ML
September 23, 2022
Julien Simon is the Chief Evangelist at Hugging Face, a machine-learning startup founded in 2016 with a goal to “democratize” ML and make it simple and accessible to everyone—not just to data scientists and ML PhDs but also to developers, business people, and other non-technical users.
Here, Julien discusses the Hugging Face’s product, Spaces, a web framework hosted by the company that offers non-technical users a simple way to build their own ML applications. Hugging Face also hosts an open-source library of more than 62,000 pre-trained models and datasets for a variety of tasks, including Natural Language Processing (NLP) and Computer Vision. Using tools provided by Hugging Face to find which models are the best fit for a particular user’s needs, anyone can simply grab a model off of the shelf and begin using it to solve their business problems with just a few lines of code.
More related videos: https://www.youtube.com/playlist?list=PLZePYakcDhmgOcjuK_rZ4bYcpUEtLBwkp
More related videos: https://www.youtube.com/playlist?list=PLZePYakcDhmgz_Mcr2D0nS1vqhuSplq6s
#machinelearning #huggingface #aiapplications
Transcript
Please give a warm welcome to Julien from Arcee. I'm so happy to get a chance to talk to all of you. Oh, thank you so much, Simon. We are so glad to have you here. And yeah, the stage is all yours.
All right. Well, let me share my screen and we can get started then. All right, here we go. So we have a short session, so I'll get straight to the point. As we all know, my name is Julien. I'm the chief evangelist for a company called Hugging Face, which you may have heard of. What do we do? Well, Hugging Face is a startup. We work with machine learning and we're trying to democratize and make machine learning as accessible and simple and straightforward as we can. We always need experts, data scientists, and machine learning PhDs, but we also need lots of developers and even business folks to join the machine learning party. That's what we're trying to build.
Hugging Face was born in 2016. And right after that, something really big happened in machine learning: the rise of transformer models. And of course, I mean the rise of Google BERT, which was the first widely known transformer model. It was launched for NLP tasks and broke all kinds of NLP benchmarks. That got everybody's attention. Since then, the transformer architecture has proven to be super efficient, not only for NLP but also for a wide range of machine learning problems from computer vision to audio and speech, and even tabular data and reinforcement learning are being handled with transformer models.
Just to show you the breadth and depth of Transformers, what we see here is the Hugging Face Hub, which is our main website at huggingface.co. As you can see, we host over 62,000 models, which is a pretty large number. It keeps growing every day. We have models for a whole bunch of different tasks, obviously for NLP, computer vision, audio, and other things, and we keep expanding. These models come from the community, organizations, and companies. You can see we have models from Microsoft, Google, Meta, and many research labs.
Let's just grab one of those models here. How difficult is it for you to work with those models? It's actually very simple because you can very simply use our open-source libraries, which are hosted on GitHub. The Transformers library, which lets you download, predict, and work with transformer models, is literally one of the most popular projects in open-source history, rising in popularity faster than amazing projects like PyTorch, Keras, or even non-machine learning projects like Kubernetes. With just a couple of lines of code, you can grab a model and predict with it. We provide you with those code snippets. You can also test the models right on the model page if you want a quick taste. We call this the inference widget, and this is a very simple way to evaluate models very quickly. We provide a detailed description of what those models are, how to use them, what data they've been trained on, and potential limitations, training procedures, training metrics, and so on. By simply browsing those models using the tags, the task tags, or the language tags, you can very quickly narrow down the list of models that you should be looking at. For example, let's say I'm interested in summarization in French. I can just click on that and I get the 12 models that I should be looking at. So super simple. Grab those pre-trained models and get to work very quickly.
We also have thousands of datasets that you can start using maybe for your proof of concepts or production. Likewise, you can just grab those datasets in seconds with just a couple of lines of code and pull them in. The combination of those thousands of models and thousands of datasets makes it very, very easy to get started and experiment with the problem you're trying to solve and build a POC very quickly.
Speaking of which, if you're a data scientist or machine learning engineer, you're well-versed in working with Jupyter notebooks, Python, and other machine learning tools. But if you demo that stuff to business stakeholders, that's not really going to fly. They want to see how a model works within an actual application, where it fits in the workflow, what the user interface and user experience are like. Jupyter notebooks don't really do that. So that's why we've built a product called Spaces. If you've been playing with Dali Mini in the last few weeks, that's certainly what you've been using. Spaces is a simple way to build machine learning applications and host them on Hugging Face using simple web frameworks. You can use Gradio or Streamlit. Gradio is actually part of Hugging Face now. You can write just a few lines of simple code and display your model in an application that looks like a real application. That's much friendlier to non-technical folks.
Let's look at an example really quick. This is a space that I built a little while ago. It runs voice queries on financial docs. I can ask questions and get insights on a corpus built from 2020 annual filings for S&P 500 companies. That sounds like a complicated thing to do, but in fact, I just used a couple of models off the shelf from the Hugging Face Hub. I didn't even train anything. I just grabbed those models and used one for semantic search and another for speech-to-text. That speech-to-text model also includes translation. Let's give it a quick try. "Notre compagnie est sous le coup d'une enquête fiscale." So that's my query. I'm going to submit it. It's going to be translated to English, converted to text, and I'm going to use my semantic search model to run the query. Just like that.
How many lines of code is this? It's a total of 113 lines, with a good third of that being the user interface. That's the kind of speed and agility you can build with Hugging Face, working with off-the-shelf models, off-the-shelf datasets, and very agile tools like Spaces. In no time, you can start building something that solves a business problem and keep iterating. That's really what we're all about.
If you're interested, there's only one place to go: huggingface.co. Thank you so much, Julien. It was such an incredible talk. We've all used Hugging Face at one point or another, and we are really glad to have you here. Thank you.