
Lesson Description
The "Zero-Shot Classification & Fill Mask" Lesson is part of the full, Open Source AI with Python & Hugging Face course featured in this preview video. Here's what you'd learn in this lesson:
Steve discusses various applications of machine learning and AI, such as zero-shot classification for categorizing text, fill mask for predicting the next word in a sentence, sentiment analysis, summarization, and named entity recognition for identifying entities like people, places, and organizations in text.
Transcript from the "Zero-Shot Classification & Fill Mask" Lesson
[00:00:00]
>> Steve Kinney: The next one is called zero shot classification. And this is basically looking at strings of text and maybe having a bunch of categories and figuring out how to correctly categorize stuff. So if you wanted to take either a piece of content of some sort and have a set of tags and be able to automatically tag stuff and classify stuff, which could work for the very first thing that probably popped into all of our heads, which is like, I could tag blog posts with that.
[00:00:32]
Yes, you could. That was the first thing that popped into my head, so I'm not judging you. Still the first thing that popped in my head today. The other things you can do is start to figure out, okay, could we then fine tune a model, figure out for the data coming into our applications that's probably fraudulent, that's probably bad in some way, shape or form or unwanted in our application.
[00:00:55]
And when we start to put some of these other things together, plus zero shop classification plus fine tuning a model, again, the interesting part is no, given one topic that we cover, the interesting part is the kind of wild intersections amongst multiple parts. So you can apply one label, multiple labels.
[00:01:13]
We'll see all this stuff when we play around with it. The next one that we'll kind of look at in our first tour of, of machine learning, AI what have you is if text generation is guess the next word, a fill mask is almost like mad libs, right where there's a blank in the sentence somewhere and it uses both the words that came before it and the words that come after to provide enough context to make a solid guess on what the next best word is.
[00:01:51]
And so effectively, if you think about ChatGPT and all these other things with your text generation, they're almost tying one hand behind their back, which is you have the ability with something like film mask to look before that word and after that word. But if you're just trying to generate text and not necessarily fill in pieces, then obviously looking forward, you don't have a forward to look at and you might not even want to look at forward.
[00:02:16]
So you only wanna look it back. And we'll actually see how that works when we get to like tokenization and embeddings and all of the like inner workings and plumbing of a lot of this stuff in the second ish chapter, arguably, if sentiment analysis is the hello world.
[00:02:34]
Summarization is probably like the first thing that we think of with a lot of the, you know, the original, prior to, you know, all the LLMs tools of just like taking long pieces of text, making shorter ones, then you play a game called Brevity versus Information Retention. You make it too short, you've sucked out all the meaning and it doesn't matter.
[00:02:57]
And if you make it too long, then why did you do this? So it becomes an interesting game there as well. But you have all those parameters and knobs that you can play along with, play around with, so on and whatnot. And then the other one, which is super cool.
[00:03:12]
Actually, I don't necessarily. I can be like, I have an immediate use case for this one, but we could probably riff and come up with a bunch, which is take a look at some text and let's figure out all of the nouns, right? You can figure out who are all the people, who are all the places, organizations.
[00:03:38]
There's just large corpuses of data that help you just pull out. Okay, is Jimmy Carter mentioned in this? You can pull out effectively all of the various different things I mentioned. Use that again and think about how that fills in with some of these other tools. And the last one, which we won't touch too much today, is just translation.
[00:04:00]
And there are a whole bunch of models out there that obviously can power this. The nice part about those is that the names of the models tend to suggest exactly what those models might. The translations that they do. For instance, you can take a lucky guess what the translation en2de does.
[00:04:29]
It translates from English to German. And so a lot of those tools as well, I think are super interesting.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops