Toxicity Classifier using Machine Learning and NLP

AI Anytime · Beginner ·📐 ML Fundamentals ·3y ago

Key Takeaways

Toxicity classifier model using TF-IDF and Naïve Bayes classifier for text categorization as toxic or non-toxic

Full Transcript

hello everyone welcome to AI anytime channel so in today's video we are going to create a text classifier model so we'll build a toxicity classifier model that will classify text between toxic and non-toxic we'll take the data from kaggle and will perform some NLP operations and then we'll use a supervised machine learning algorithm to you know create this model which will be a binary classific binary classifier so we are going to create a binary classification model here and we'll use classical machine learning algorithms to create the model so let's see which data that we are going to take so if you see I am on kagger right now and we'll take this toxic tweets data set okay which says a balanced data set of tweets containing head speech and offensive languages we will take this data set and we'll create the model then we will dump that model we'll serialize that model so we can use that model in our applications or for the other use cases that we have as this data has been you know downloaded or scrapped from Twitter basically these are tweets but at in end these are all Text data this can be used the model that we are going to train can be used or leveraged in other tasks like you know if we have uh reviews and feedback right if you see on Amazon or any other website where where these companies provide products and services and their offerings people kind of comment and sometimes they also comment a lot of they also abuse and you know comment uh toxic uh comment there okay these are not appropriate comments that they make you know on on this e-commerce sites or even on different applications or products that we are providing same happens on YouTube YouTube has a feature which says you know if if you if the content creator wants they can you know delete some or they can held some comments okay from the subscriber or even the unscripted subscribers okay so YouTube use this kind of you know technology where they find out and they filter out okay most of them are non-toxic but few of them are toxic and if the content creator wants they can uh you know held that comment and they can not publish that comment okay so this this kind of models can be used there you know to solve this kind of problems that we face okay and that we have even we will build this we can build this as an API and we can use this in our application and offerings okay so this is the data set if you come down uh you'll find a metadata also and it has around uh 50 000 plus rows uh it's a very balanced data and a good one to work along with and it says label we have a label here toxicity indicating whether our tweet is talks thick or not okay so let's do this guys so what I will do I already have downloaded the data in my uh machine and what I'll do I'll use Google collab let me upload the data I will upload it in the runtime so I'll not uh I'm not mounting it okay I'll just upload it uh and we can also mount it to drive you can also you know download this data directly using W gate or you can also save it on your drive and you can mount your collab with a drive and you can just download it from there okay I just uploaded in in the runtime but make sure if you upload in the runtime if your session is uh closed uh you will lost all this data and your uh models if you save that model so now what we'll do we'll import let me just import a few of the packages import ant leave dot file float as PLT percent dot leave dot inline just because you can visualize that inside this notebook so this is how going to be the three of the Imports these are you see that ninety percent of the machine learning models kind of you know involve these libraries these three of the libraries and the panda is decent for you know this amount of data that we have if you have big data and you can use other tools or libraries like Pi spark or you can use Dusk and you know wax and a lot of other libraries that we can use okay so now what I what I have to do now to import this data so what I'll do I'll say data and let me quickly load this with pandas which is final balance excuse me data set dot TSB this is going to be my data and let's info about the data so you can see we have a it looks like we have an extra column so let me just do a head and see fill up the rules and you can see I we have to drop this unnamed maybe we would have done index call equal to zero so you might have dropped that so so let me just do this so unnamed 0 do not need this and X is equal to 1. and now data dots hit so you can see we have around 56 745 entries and now you can see so we have toxicity column which is the label and we have Tweet now let's do one thing we we can also let's find out how many of them are toxic and non-toxic value counts toxicity you can see one being non-toxic and zero means uh now one means toxic and zero means non-toxic so we have around 24 000 of rows which contain some kind of you know toxic content okay so now what we will do guys we need uh if you see this data this is not clean you can see at the rate user when a father is not as functional and all okay so we have at the rate we have hash we have colon here we have to clean this data we also have to limitize the data now if a question will come what is what do you mean by limit eyes and limitization I will explain that you know in a very layman term what is limitizations now what we are going to do first we have to first import this nltk we have to work with natural language toolkit it provides some part of the speech tiger the POS tagger it provides some limitizer modules it provides you a lot of other different modules where we we can work with it so what I'm going to do now okay I I'll ever have a function maybe so let me go to my gist I have all my nltk imports here I'll just copy this I'm going to write it these are you might have seen it earlier also if you have worked with natural language toolkit okay if you see this we are importing natural language tool toolkit you do not have to install nltk in Google collab guys because it comes pre-installed uh import nltkn uh but if you are creating a virtual environment in your machine offline or locally you have to install this these are all required dependencies these are all POA stagger we have average perceptron tagger we have you know stopwatch I think average perceptron Tiger has been trained on you know walls Journal data the text Data okay these are all POS tag or OMW 1.4 or all the data that we are and then we are also getting limitizer now now what do you mean by limitizer guys so let me let me just write it limitizer here so Lema means basically if you go in search in the dictionary means the word which are the dictionary meaning okay dictionary meaning so now let's for example let's understand like this we have leaves and then we have leaf these two right now you know we can group them okay and this can have a single dictionary meaning okay we can create a Lemma out of it but the Lemma will be nothing but the leaf this is your lemur right this is so basically here we are creating ah what we'll do we'll have this text Data okay first we have to clean it once we clean it will uh limitize those texts to find out the most uh value which are having dictionary values okay the text which will have dictionary values and the multiple words can be you know bind in the same group and they can have a same value there also that's what we mean by limitization guys the very limit terms we have leaves and we have leaves and leaves but the dictionary value can be Leaf okay so we have to limitize this in a lot of if you see examples okay uh SEO the search engine optimization is a prime example where you know this this is this is being used on the vast extent Okay so let me just comment it out okay so what we have to do now we have to we have imported all this natural language toolkit libraries and dependencies what we are going to do we are going to uh create a variable where we will initiate this Constructor or method so I'll call it wordnet limitizer equals and you see we have imported this word net limitizer here we just have to uh initiate the method so one net limitizer okay we just doing this foreign okay yes sorry and I wanted to limit as the element okay now what we have to do we have to clean this text guys okay and most of the time when you work with Text data you will have messy data I will have uh uncleaned or raw data and you have to have a function okay that kind of you know helps you clean those data that can be with regular expressions and that can give you the POI stagger we have to limitize it and then split and join it so what I have done if you see these are all my gist I'll give the this gist Link in the description as well I have several function that I have created and I use these functions on my day-to-day work activities that can be you know working with Text data when I'm working with tabular data then I have some other code Snippets ready which I keep it handy so this this helps to increase the productivity when I am working okay so what I'm going to do now I'm just going to copy this I'll explain this so if you see what we are doing we have a function here which kind of first uh we are looking at the POI stagger if which finding out that okay we have adjective we have o we have noun if we have adverb return it if you don't then just return the noun and then what we are doing we are using regular expression I think we have to import it you can see I am getting a warning here so what I will do I'll just say import re which means regular expressions and yes you can see now it has been removed and yes so you see we have this uh if you see at the rate hash colon and the next line and the other things we are handling these things with regular Expressions A to Z and finding out all those special characters and then we have uh we are tokenizing it and we are using this Lemma here right the limitizer see this is a variable wordnet limitizer and I am using limitize and I'm just passing this on uh gateward net pose and that's returning the Lemma term terms is like a dictionary value or a dictionary meaning okay so return Lima so this is my function now what we have to do guys we have to apply this function so let's apply this function so now on this tweet we have to create a new column where our clean a clean tweet uh will be there like we have to store store it somewhere right so we'll create a new column guys here so what I'm going to do now I'm going to call data and I'm going to call it clean tweet 10 tweets let's call it clean tweets and what I'm going to do now I'm going to use that column do we excuse me where and I'll apply my function that I created a verb apply I'll use Lambda X and here I'm what was my function name excuse me which is a prepared text prepare text and I'll just pass that X that I have signed with Lambda I think this should do it will take little time guys because we have around 50 000 odd rows and it's not a small data to work with it's a very decent data and it will take little time because it has to go through the in all of the rows then you have to perform the this function prepare text and then it has to again create a new column and then join it and then you know create a this data frame so let's wait for it so what we are going to do now is that okay let me even write data dot hit till we get this once once we limitize the text we'll have a cream text and the reason we are doing this clean text is because we have to create the feature okay create a feature set where we can train our model right on that features that we create and for feature creation we'll use TF IDF okay that we will also import it I'll just throw it in a bit let me write okay now let me do data dot head five I think it has done and now if you see we have clean tweets and you see the Tweet now you can see right user when a father and then you had add the rate everything has been cleaned right you see this um hash was there has ignore their model I love you take with you all the time in your and then facts guide Society now motivation right so we have cleaned our tweets now now what we will do will use this tweet will we have to use this clean tweets column and we have to then use the TF IDF and all so let's see how we can do it okay then for that we have to uh import our SQL on scikit-learn packages so from sqlon Dot feature extraction dot text and then we'll import the TF IDF excuse me TF IDF vectorizer okay this is the first thing that we have to load we also have to load from sklearn dot model selection and we have to get the train test split because they have to create that training and test data it and we need some of the evaluation metric guys so what I'm going to do now uh from okay let's first load the model so we'll use a nav base here uh to create this binary classifier of toxicity and non-toxicity on top of text it works nav base works very good on the text Data guys when you have to build text classifier you can also try some other models so for today's video we'll use a nav based multinomial layer based model that I will be showing you that how we are going to create that model so from SK learn dot uh nav base and we'll import excuse me import now we have imported the model now what we have to do we have to import uh the metric so we'll we'll import some metrics okay so first is SQL un.metrix and then import uh Roc curve policy curve and RSE AV score that's good so from sk1 dot matrix let's import Roc is code and then TUC score for Roc curve sorry okay so we're done with the Imports guys now what we'll do we'll write our uh code to through the TF IDF on the screen tweets so let me first create a variable which will what we will do it will have a my data of clean tweets let me charge the monitor just give me a minute plugin yes so what I'm going to do guys now we will have defined this Corpus so let me Define this Corpus and Corpus equal to data and then we'll have this green tweets excuse me the screen tweets dot values and Dot as type because it might have been in given C initial as type U let's type as U Corpus and now it stop words what I'm going to do the stopwatch now is that we have to set the uh that okay need the English because we have English text only right we do not have any other languages here so nltk stop words dot words and will use only English and we'll use this stop words in the function when we are creating this TF IDF okay so let's do this stock ports and now what I'm doing I'm not doing count PF IDF count TF IDF equal to TF IDF and vectorizer is and then passing the stop words stop underscore words equals and then we have this stop words so here we have this Define Outlet we have to do a fit transform guys so with this on this count uh TF idea variable where we have this uh method of idea what I'm going to do count F here then we have to fit transform fit transform and then we have to pass this Corpus that's it count TF IDF this should do and this will take a little time when we are you know dumping it so what we'll do guys we'll we'll dump this we will save this uh TF IDF that we have created because when we do not want to run this every time when you are doing a testing or when you are inferencing it or when you are you know integrating this somewhere okay so this model development is a very small part this can be a very small part of your entire end-to-end uh solution that you are building okay so when you are testing it or when you're creating an API or integrating this in an application every time a new input has been you know search or had been given by the end user this will not go and create TF IDF and all these features okay so what you have to do you have to dump this so for that I will use pickle import pickle for picologist serialization Library which realize our models with help of pickle or job leaf or any other uh there are a lot of other libraries that you can use to realize your models so I will use the same I'll say pickle dot dump I will dump this and I'll use this count and count TF IDF and then what I'm going to do now is that I'll use open and here I will just give it a name which is TF IDF okay TF IDF Dot pkt and we have to write it so let's write okay I'm using terms there's nothing called dumb dumbs so this is dumb so pickle dot dump count TF IDF open TF area to pick it in now let me rephrase this you can see that my features have been here okay so now if I'm testing it out once I build the model I have to test it I do not have to use this I can just load this TF IDF and then I can just you know pass my input text and then model will be on run on that top top of that so this is what we did okay now what we have to do we have to create the training and testing set to train the model so so let's do that so the first thing will be the TF IDF train and the TF IDF test TF IDF train and TF IDF test and then we'll have a Target train and then we'll have Target test and what next print split the module that we have imported from SK loan dot model selection and here we have to Define all our you know couple of things which is first is where our data is restore the feature that we have created TF IDF and then we have the target so Target is nothing but our toxicity what was that we have toxicity so this is nothing but the toxicity column you can also you know assign them in a variable called y or something and then we can do it from there so data toxicity and what we have to do now we have to take size so test size equal so let's have 80 percent so 0.8 and for reproducibility and suffer so what is that random uh random state equals something 42 and then suffer equals to so let's the data to suffer and that's it so this is done so now what we will do we'll create the model so let me just write create uh excuse me create a binary classification model here and let me just write it here so little bit of documentation so create just let write TF TF IDF for features and let me here call it text pre-processing that's it now here what we will do we'll create a binary classification model guys so what I'm going to do now again we'll first uh a variable where I have this will set this method multinomial MB that's it and now it will pay equals model paste dot fit will fit uh here this TF IDF train and Target train so TF IDF train excuse me TF IDF train and Target train that's it so now let's do one thing okay we have now let's uh create a variable we'll test the ah you will evaluate it so white bread Prova and then what we'll do we'll have model base we'll put it on the test data so what we're going to do first more is model based Dot predict predict probability or program then model based or predict Prova and what we have will pass the TF IDF excuse me TF IDF test and TF IDF test and then hold on colon comma 1 just need to uh if you run this you will get a array where you'll be list of array where you'll see that you will not be able to understand anything right now so what we'll do let's just first create the fall for the team rate and true positive rate okay tpr and fpr and then here we'll test on our input text guys so appear and tpr and then what we'll do now we'll uh let's see and we'll pass this uh test that we have created Target test and why create four bar so Target underscore test and my plate over variable okay Roc curve and now final Roc and AUC okay and for that what we'll use Roc excuse me not Capital AUC we have imported this CSC score and then we pass the target test and the vibrate group excuse me and now let's print this so 96 percent so this looks good A very decent model okay we will test it out and then we'll see if it's able to you know predict it correctly I'll classify it correctly so you can see that we got around final Roc AOC score of 96 percent now what we'll do now let's have a sample so what I'm going to do I'm going to say test test text and in this text I'll just write it was an amazing you know amazing experience suppose this is my this is my text and I want to test the model on this test text okay so what I'm going to do now I'm going to do do test ID or test DF IDF and thus we have to use this TF IDF we have to do the transform guys so what I'm going to do now I'm going to do the count that variable of the count TF IDF and then transform transform and we have to pass this inside a list which is district and then let's do test text and TF test uh underscore T of IDF and then let's display so display model based dot predict and we have to predict this just to predict crowbar and then predict we also get the accuracy of both the labels to predict Roba and then here we'll pass the test uh PF IDF this TF IDF display model base dot only predict and then pass the test TF IDF one will give you the accuracy for both the classes and this will give you only the which class that it belongs to the maximum one so let's see that so you can see uh this was my input text it was an amazing experience and it's able to predict uh classify very correctly guys so 90 with the average 0 which means non-toxic one being the toxic now I'll do one thing I'll just replace this I'll say I I hate you or something okay now let's see wow so you can see that when I when I'm writing here I hate you more on as a test text as a sample it's able to classify if this is a toxic comment okay you can see the value here right the accuracy and here you can see the class array one okay so this is basically the zero and this is the one and the maximum value of being one so what I'm going to do now guys that you know we can also let's save this model okay and then we'll use this model to create an API with the help of fast API and then we'll host that fast that API on rapid API I'll also show you that how you can create uh and if a machine learning API right we call it AI as a service or AI as an API and how you can host that API or rapid API or any other API gateways right so now what I'm going to do um let's write a text here save the model and we'll again use pickle to save the model so I'm going to say model base where we have uh so no need of that so what I'm going to do pickle dot dump because we already have imported and we already have the model there so pickle.dum and model base and here it will be open again and here we'll give the model name so I'm going to call it toxicity model Dot pkt and here it will be right so let me rephrase this so you can see the model here so let me do one thing let me first download this model download it on desktop a little bit create so we'll also create a project folder here for the next video so let me create a toxicity classific classifier app and inside this I'll save this and let me also download this tfidf.pkt so you do not have to create it again and again so let me save this we'll just load this model weights and this TF ID of the feature and then we'll just create a function where this will take an input and in return it will give you the label which is a toxic or non-toxic okay so this is what we did in this video guys we took this data from kaggle toxic tweets data set we used a this nltic natural language toolkit to you know clean the data and limitize that data once we limitize that with coordinate limitizer we you know created the feature with TF IDF and once we have the features we then used our binary classification like created a binary classification model with help of multinomial an air base and we then saved the model we got a Roc AC score of 96 you can see it over here right and then we also tested it now we have saved the model so in next video what we are going to do guys we will take this video will first build a an API and also will build a streamlit application we'll deploy that stimulate application on GitHub from from GitHub to share streamlit and then we'll create that API and we'll host that API in Rapid API guys so stay tuned for the next video we will I will scale this up and also extend this we'll deploy this uh this model that we have created you know through an API and also an application so if you like this video uh please like and please uh subscribe if you haven't subscribed yet and please share this Channel and this video with your friends and impair thank you so much for watching this video see you in the next next video guys thanks

Original Description

In this video, we present a toxicity classifier model that accurately categorizes text as toxic or non-toxic. Our model uses the TF-IDF method to extract relevant features from the text, and a Naïve Bayes classifier to make predictions. This model can be used in various applications such as online moderation, sentiment analysis, and much more. Watch the video to learn more about how our toxicity classifier works and its potential uses. GitHub Link: https://github.com/AIAnytime/Toxicity-Classifier-App Dataset Link: https://www.kaggle.com/datasets/ashwiniyer176/toxic-tweets-dataset #ai #artificialintelligence #machinelearning #python #kaggle #googlecolab
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI Anytime · AI Anytime · 11 of 60

1 Spelling and Grammar Checking Streamlit App: Building Docker Image
Spelling and Grammar Checking Streamlit App: Building Docker Image
AI Anytime
2 Spelling and Grammar Checking Streamlit App: Docker Image and Docker Hub
Spelling and Grammar Checking Streamlit App: Docker Image and Docker Hub
AI Anytime
3 Image Caption Generator: Google Colab and Hugging Face
Image Caption Generator: Google Colab and Hugging Face
AI Anytime
4 Low Code/No Code AI Platform Teachable Machine: Brain MRI Image Classification
Low Code/No Code AI Platform Teachable Machine: Brain MRI Image Classification
AI Anytime
5 Low Code/No Code AI Platform Teachable Machine: Testing the Model
Low Code/No Code AI Platform Teachable Machine: Testing the Model
AI Anytime
6 Low Code/No Code AI Platform: Streamlit App for Brain MRI Image Classification
Low Code/No Code AI Platform: Streamlit App for Brain MRI Image Classification
AI Anytime
7 Readme Generator Streamlit App using ChatGPT
Readme Generator Streamlit App using ChatGPT
AI Anytime
8 Generate Minutes of Meeting (MoM) from Video using ChatGPT: AI as an API
Generate Minutes of Meeting (MoM) from Video using ChatGPT: AI as an API
AI Anytime
9 The Great AI Showdown: ChatGPT vs ChatSonic 🔥
The Great AI Showdown: ChatGPT vs ChatSonic 🔥
AI Anytime
10 Generating Transcripts and News Article with Whisper, GPT-3.5, ChatGPT and Streamlit
Generating Transcripts and News Article with Whisper, GPT-3.5, ChatGPT and Streamlit
AI Anytime
Toxicity Classifier using Machine Learning and NLP
Toxicity Classifier using Machine Learning and NLP
AI Anytime
12 Toxicity Classifier API using FastAPI
Toxicity Classifier API using FastAPI
AI Anytime
13 Toxicity Classifier Streamlit App
Toxicity Classifier Streamlit App
AI Anytime
14 Low-Code Insurance Prediction with PyCaret and Streamlit
Low-Code Insurance Prediction with PyCaret and Streamlit
AI Anytime
15 Deploy Streamlit Python Application for Free
Deploy Streamlit Python Application for Free
AI Anytime
16 GPT3 Powered Text Analytics App
GPT3 Powered Text Analytics App
AI Anytime
17 AI Image Generation Streamlit App
AI Image Generation Streamlit App
AI Anytime
18 Streamlit and txtai: Building an Abstractive Summarization App in Python
Streamlit and txtai: Building an Abstractive Summarization App in Python
AI Anytime
19 Building a Topic Modeling and Labeling app with Streamlit
Building a Topic Modeling and Labeling app with Streamlit
AI Anytime
20 The Art of AI: Exploring Midjourney, Dall-E, and Lexica
The Art of AI: Exploring Midjourney, Dall-E, and Lexica
AI Anytime
21 Exploring the latest Large Language Models (LLaMA and Alpaca)
Exploring the latest Large Language Models (LLaMA and Alpaca)
AI Anytime
22 Comparing LLMs like GPT-X, LLaMA, and Alpaca: Analyzing the Perplexity Score
Comparing LLMs like GPT-X, LLaMA, and Alpaca: Analyzing the Perplexity Score
AI Anytime
23 GPT-3 powered Q&A App using Langchain, GPT-Index, and Gradio
GPT-3 powered Q&A App using Langchain, GPT-Index, and Gradio
AI Anytime
24 All things #ai . Latest and greatest in AI. #tech #python #chatgpt #youtubeshorts #shorts #gpt3
All things #ai . Latest and greatest in AI. #tech #python #chatgpt #youtubeshorts #shorts #gpt3
AI Anytime
25 Text-to-Video Generation using a Generative AI Model
Text-to-Video Generation using a Generative AI Model
AI Anytime
26 #ai brand name generator. #artificialintelligence #tech #shorts #youtubeshorts #youtube #chatgpt
#ai brand name generator. #artificialintelligence #tech #shorts #youtubeshorts #youtube #chatgpt
AI Anytime
27 Talking AGI with Sam Altman: A Deepfake Showcase
Talking AGI with Sam Altman: A Deepfake Showcase
AI Anytime
28 A conversation with ChatGPT creator Sam Altman. #tech #technology #ai #shorts #viral
A conversation with ChatGPT creator Sam Altman. #tech #technology #ai #shorts #viral
AI Anytime
29 Get to Know Anthropic's Claude: The Ultimate ChatGPT Competitor
Get to Know Anthropic's Claude: The Ultimate ChatGPT Competitor
AI Anytime
30 #shorts #chatgpt #python #datascience #tech #coding
#shorts #chatgpt #python #datascience #tech #coding
AI Anytime
31 Recipe Generator App from Cooking Videos using Whisper and ChatGPT
Recipe Generator App from Cooking Videos using Whisper and ChatGPT
AI Anytime
32 Segment Anything Model by Meta AI: An Image Segmentation Model
Segment Anything Model by Meta AI: An Image Segmentation Model
AI Anytime
33 One of the best #ai #books based on #tensorflow. #tech #coding #shorts #chatgpt #machinelearning
One of the best #ai #books based on #tensorflow. #tech #coding #shorts #chatgpt #machinelearning
AI Anytime
34 Music Generation using Mubert #ai . #music #shorts #youtubeshorts #chatgpt #generativeai
Music Generation using Mubert #ai . #music #shorts #youtubeshorts #chatgpt #generativeai
AI Anytime
35 Image to Text Prompt: Reverse Engineering AI Image Generation
Image to Text Prompt: Reverse Engineering AI Image Generation
AI Anytime
36 Image Generation for #ramadan using #ai. #midjourney #chatgpt #shorts #youtubeshorts #islam
Image Generation for #ramadan using #ai. #midjourney #chatgpt #shorts #youtubeshorts #islam
AI Anytime
37 How to build an AI-ready organization: Cultivating a Data-Driven Culture
How to build an AI-ready organization: Cultivating a Data-Driven Culture
AI Anytime
38 Midjourney: Generate AI-powered Images
Midjourney: Generate AI-powered Images
AI Anytime
39 Getting Started with Graphs: A Beginner's Guide (Part 1 of GNN Series)
Getting Started with Graphs: A Beginner's Guide (Part 1 of GNN Series)
AI Anytime
40 Build India's First ChatGPT like App for Politics: BJP-GPT
Build India's First ChatGPT like App for Politics: BJP-GPT
AI Anytime
41 Meet BJP-GPT.... @AIAnytime  #bjp #news #shorts #tech #chatgpt #ai #youtubeshorts #coding #video
Meet BJP-GPT.... @AIAnytime #bjp #news #shorts #tech #chatgpt #ai #youtubeshorts #coding #video
AI Anytime
42 ChatPDF... #chatgpt  for PDF files. #ai #generativeai #shorts #youtubeshorts #coding #tech #ai
ChatPDF... #chatgpt for PDF files. #ai #generativeai #shorts #youtubeshorts #coding #tech #ai
AI Anytime
43 Free AI Image Generation #ai #chatgpt #coding #tech #shorts #youtubeshorts #shortvideo #generativeai
Free AI Image Generation #ai #chatgpt #coding #tech #shorts #youtubeshorts #shortvideo #generativeai
AI Anytime
44 Transform old photos into Vibrant Memories with Deoldify AI: Build a Streamlit App
Transform old photos into Vibrant Memories with Deoldify AI: Build a Streamlit App
AI Anytime
45 Open Assistant: The Real Open-sourced LLM
Open Assistant: The Real Open-sourced LLM
AI Anytime
46 Thanks to @YannicKilcherand team for the open sourced LLM Open Assistant. #ai #shorts #tech
Thanks to @YannicKilcherand team for the open sourced LLM Open Assistant. #ai #shorts #tech
AI Anytime
47 Search Engine for AI generated images. #ai #tech #technology #generativeai #chatgpt  #shorts #video
Search Engine for AI generated images. #ai #tech #technology #generativeai #chatgpt #shorts #video
AI Anytime
48 Generative AI Video Platform "Synthesia" #shorts #youtubeshorts #ai #tech #chatgpt #generativeai
Generative AI Video Platform "Synthesia" #shorts #youtubeshorts #ai #tech #chatgpt #generativeai
AI Anytime
49 Text to speech Voice AI platform. #shorts #youtubeshorts #ai #tech #technology #python #coding
Text to speech Voice AI platform. #shorts #youtubeshorts #ai #tech #technology #python #coding
AI Anytime
50 Create Amazing Videos with ChatGPT and Pictory: Free AI-powered Video Creation
Create Amazing Videos with ChatGPT and Pictory: Free AI-powered Video Creation
AI Anytime
51 Want to create beautiful video using #chatgpt and #pictory ? Watch the tutorial on channel. #ai
Want to create beautiful video using #chatgpt and #pictory ? Watch the tutorial on channel. #ai
AI Anytime
52 Animate your photos using AI. Bring old family photos to life. #ai #tech #shorts #shortvideo #coding
Animate your photos using AI. Bring old family photos to life. #ai #tech #shorts #shortvideo #coding
AI Anytime
53 Create a PDF Search and Summarization Tool in less than 100 Lines of Code: GPT-Index and Streamlit
Create a PDF Search and Summarization Tool in less than 100 Lines of Code: GPT-Index and Streamlit
AI Anytime
54 Text to Video Generation using Videocrafter: Intuitive Math behind Latent Diffusion Model
Text to Video Generation using Videocrafter: Intuitive Math behind Latent Diffusion Model
AI Anytime
55 Gamma AI: Create presentation PPT easily with #ai . #chatgpt #shorts #shortvideo #tech #coding
Gamma AI: Create presentation PPT easily with #ai . #chatgpt #shorts #shortvideo #tech #coding
AI Anytime
56 Tripnotes: Free AI tools for your trip planning. #ai #chatgpt #shorts #youtubeshorts #video
Tripnotes: Free AI tools for your trip planning. #ai #chatgpt #shorts #youtubeshorts #video
AI Anytime
57 Meet Bark (New Text to Speech Model): Clone Any Voice to Generate Music and Speech
Meet Bark (New Text to Speech Model): Clone Any Voice to Generate Music and Speech
AI Anytime
58 Fliki: The free AI video creation tool. #ai #shorts #shortvideo #youtubeshorts #chatgpt #tech #news
Fliki: The free AI video creation tool. #ai #shorts #shortvideo #youtubeshorts #chatgpt #tech #news
AI Anytime
59 Ask Anything Tool: Chat with Your Video using ChatGPT, MiniGPT4, and StableLM
Ask Anything Tool: Chat with Your Video using ChatGPT, MiniGPT4, and StableLM
AI Anytime
60 HuggingChat: Open Source ChatGPT (Interface and Model)
HuggingChat: Open Source ChatGPT (Interface and Model)
AI Anytime

This video presents a toxicity classifier model that uses TF-IDF and Naïve Bayes classifier to categorize text as toxic or non-toxic. The model can be used in various applications such as online moderation and sentiment analysis. By watching this video, you will learn how to build and deploy a toxicity classifier model using machine learning and NLP.

Key Takeaways
  1. Import necessary libraries and load the dataset
  2. Preprocess the text data using TF-IDF
  3. Train a Naïve Bayes classifier model
  4. Evaluate the model's performance
  5. Deploy the model for text categorization
💡 The TF-IDF method is effective in extracting relevant features from text data, and the Naïve Bayes classifier is a suitable choice for text categorization tasks.

Related AI Lessons

Mastering TypeScript — Understanding the TypeScript Compiler (tsc) from Scratch — Lesson 2
Learn the basics of the TypeScript compiler to write better JavaScript code
Medium · JavaScript
Stop Overfitting With Basically One Line of Code
Learn to prevent overfitting with a simple code tweak and understand the difference between Ridge and Lasso regression
Medium · AI
Stop Overfitting With Basically One Line of Code
Learn to prevent overfitting in machine learning models with a simple code tweak and understand the difference between Ridge and Lasso regression
Medium · Machine Learning
Stop Overfitting With Basically One Line of Code
Prevent overfitting in models with a simple code tweak, understanding the difference between Ridge and Lasso regression
Medium · Data Science
Up next
Learn Deep Learning by Hand (Beginner's Guide - Part 1)
Thu Vu
Watch →