Complete Natural Language Processing (NLP) Tutorial in Python! (with examples)

  Рет қаралды 131,278

Keith Galli

Keith Galli

Күн бұрын

In this video we go through the major concepts in natural language processing using Python libraries! We use examples to help drill down the concepts. There is content in this video for all skill levels (beginners to experts). I originally recorded this video for the PyCon Conference.
GitHub repo: github.com/KeithGalli/pycon2020
Patreon: / keithgalli
YT Membership: / kgmit
Some of the topics we cover:
- Bag-of-words
- Word vectors
- Stemming/Lemmatization
- Spell correction
- Transformer Architecture (Attention is all you need)
- State of the art models (OpenAI GPT, BERT)
Some of the libraries used:
- sklearn
- spaCy
- NLTK
- TextBlob
Hope you enjoy & let me know if you have any questions! Make sure to subscribe if you haven't already :).
-------------------------
Follow me on social media!
Instagram | / keithgalli
Twitter | / keithgalli
If you are curious to learn how I make my tutorials, check out this video: • How to Make a High Qua...
Practice your Python Pandas data science skills with problems on StrataScratch!
stratascratch.com/?via=keith
Join the Python Army to get access to perks!
KZfaq - / @keithgalli
Patreon - / keithgalli
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
-------------------------
Song at the end
good morning by Amine Maxwell / aminemaxwell
Creative Commons - Attribution 3.0 Unported - CC BY 3.0
Free Download / Stream: bit.ly/2vpruoY
Music promoted by Audio Library • Good morning - Amine M...
-------------------------
Video Timeline!
~~ NLP Fundamentals ~~
0:00 - Announcements!
1:12 - Video overview & timeline
3:06 - Bag of words (BOW) overview
4:42 - Bag of words example code! (sklearn | CountVectorizer, fit_transform)
11:20 - Building a text classification model using bag-of-words (SVM)
14:07 - Predicting new utterances classes using our model (transform)
16:02 - Unigram, bigram, ngrams (using consecutive words in your model)
19:28 - Word vectors overview
23:27 - Word vectors example code! (Using spaCy library)
28:10 - Building a text classification model using word vectors
34:04 - Predicting new utterances using our model
~~ Miscellaneous NLP Techniques ~~
40:42 - Regexes (pattern matching) in Python.
52:30 - Stemming/Lemmatization in Python (text normalization w/ NLTK library)
1:01:17 - Stopwords Removal (removing most common words from sentences)
1:05:56 - Various other techniques (spell correction, sentiment analysis, part-of-speech tagging).
~~ State-of-the-art Models ~~
1:12:45 - Recurrent Neural Networks (RNNs) for text classification
1:17:00 - Transformer architectures (attention is all you need)
1:21:00 - Writing Python code to leverage transformers (BERT | spacy-transformers)
1:25:00 - Writing a classification model using transformers/BERT
1:29:37 - Fine-tuning transformer models
1:31:16 - Bring it all together and build a high performance model to classify the categories of Amazon reviews!

Пікірлер: 100
@KeithGalli
@KeithGalli 2 жыл бұрын
I created a second channel where I post more Python content, check it out! 😊 kzfaq.info
@reubenseyram7918
@reubenseyram7918 Жыл бұрын
can you teach knowledge graphs for beginners asap lol!
@lakshyashrungarpure
@lakshyashrungarpure 2 жыл бұрын
I got a job because of your tutorials!! Thanks Keith🤩
@KeithGalli
@KeithGalli 2 жыл бұрын
Love to hear that!! You're very welcome :)
@kamilcopur6513
@kamilcopur6513 2 жыл бұрын
Could you explain some more detail please?
@jenna9653
@jenna9653 Жыл бұрын
What kind of job did you get? What schooling did you have in advance? I'm considering creating projects like this for a portfolio
@prateekyadav9811
@prateekyadav9811 Жыл бұрын
+1 what Jenna asked. Please share Lakshya
@francis191
@francis191 2 жыл бұрын
Great to see you back Keith. Wishing you all the best in your recovery.
@pawan-de7ow
@pawan-de7ow 2 жыл бұрын
Glad to have you back and making awesome tutorials. Have learnt alot from you.
@v1hana350
@v1hana350 2 жыл бұрын
Finally, you came back. I liked your explanation.
@alan6506305
@alan6506305 2 жыл бұрын
Bookmarking this and will watch it in the morning.
@KeithGalli
@KeithGalli 2 жыл бұрын
It will be here in the morning waiting for you!
@kentii4608
@kentii4608 2 жыл бұрын
Same
@alan6506305
@alan6506305 2 жыл бұрын
@@user-ut8xk4ky9q haha, literally watched it that morning.
@Amulya7
@Amulya7 Жыл бұрын
This is a great introductory tutorial on NLP. Perfect for a newbie
@edsonwinnerify
@edsonwinnerify 2 жыл бұрын
Glad you are back Keith!!!!
@bosszz1282
@bosszz1282 2 жыл бұрын
I've been following your tutorials, but I've been busy with object detection lately, so I'll be watching this nlp video of yours later
@avixek
@avixek 2 жыл бұрын
You are probably one of the smartest guy on youtube. Keep making your videos. You are doing God's work!!!
@zulekhaimtiaz6620
@zulekhaimtiaz6620 Жыл бұрын
Heyy Keith!! I just want to thank you sooo much. I applied for an internship which required for me to submit an assignment on data classification and your SKLearn video helped me soo much with the task! I really am so grateful to you! Your tutorials are the best!
@KeithGalli
@KeithGalli Жыл бұрын
Glad you like the videos and happy that specific one helped you with the task! Hope you land the internship!
@shivamsahu9998
@shivamsahu9998 11 ай бұрын
Thank you, Keith. Your session helped me a lot.
@adeshmishra1671
@adeshmishra1671 2 жыл бұрын
Good to see you back with bang!!
@srijitbhattacharya6770
@srijitbhattacharya6770 2 жыл бұрын
Good to see you. Bookmarking this
@richarddankwah3088
@richarddankwah3088 2 жыл бұрын
Glad to See this Mr. Keith. Always impressive and fun. Thank you very much. But am your big fun as well
@muhammadzakiahmad8069
@muhammadzakiahmad8069 Жыл бұрын
Amazing tutorial Mr.Keith, I just wanted to have a know how of NLP and this tutorial was perfect for it.
@amansorout.6779
@amansorout.6779 2 жыл бұрын
Damn, I am very happy you are back bro. 😀
@DJdopeMike
@DJdopeMike Ай бұрын
Thank you for the great overview of NLP!
@eldarhasanov
@eldarhasanov Ай бұрын
Thank you for this guide!
@christianondo9637
@christianondo9637 2 ай бұрын
great tutorial, thanks so much for putting this out there. It's pretty crazy how easy it is to learn stuff if you're willing to search youtube
@nazrulxh
@nazrulxh Жыл бұрын
great tutorial brother. Highly appreciated
@wahaha108
@wahaha108 2 жыл бұрын
hi Keith, great video. You provide an one-stop service, hhh. Great!
@RichardHarrowz
@RichardHarrowz 2 жыл бұрын
LOVE TO SEE YOU AGAIN MAN! LOVE THE CONTENT AND HOW U EXPLAIN!!!!
@KeithGalli
@KeithGalli 2 жыл бұрын
THANK YOU
@Rapperabstar
@Rapperabstar Ай бұрын
😂 it is too late to comment but seems like someone is playing with the uppercase letters 😂
@markgolob4677
@markgolob4677 2 жыл бұрын
Awesome video, thanks!
@codewithkarthik7136
@codewithkarthik7136 2 жыл бұрын
It would be super nice if you would make a text generation video. As always loved the vid keith
@Rapperabstar
@Rapperabstar Ай бұрын
I don’t usually comment on the video but when I do it, means that I really loved the content❤ thanks for helping me to learn some new stuffs
@AleDP
@AleDP 8 ай бұрын
love the video, thanks
@jorgeromero141
@jorgeromero141 2 жыл бұрын
You are the best my bro
@rahulk92
@rahulk92 2 жыл бұрын
Keep this coming. I would like to see more such video - this is great. Multi language models and different pytorch eco system transformers
@letsjoinhands
@letsjoinhands 2 жыл бұрын
I got to know about, use and love pandas from your tutorials.
@bengeorge9063
@bengeorge9063 2 жыл бұрын
Thank you!
@KeithGalli
@KeithGalli 2 жыл бұрын
My pleasure! Hope it's helpful
@m.hassan8142
@m.hassan8142 2 жыл бұрын
learning alottt :) must watch SOTA learning
@andyh964
@andyh964 8 ай бұрын
Legit learned more from this video than my masters programme
@shefalisingh4675
@shefalisingh4675 Жыл бұрын
Hey Keith!!! I really like your approach to teaching, make things simpler and approachable. I need to create a chat GPT kind of functionality for my project, need your input on that and how to approach it as it's very new to me. Looking forward to hearing from you!!!
@christodoulosasiminidis8658
@christodoulosasiminidis8658 2 жыл бұрын
Recurrent Neural Networks are awesome especially for sequential patterns such as word embeddings and words sequence.
@christodoulosasiminidis8658
@christodoulosasiminidis8658 2 жыл бұрын
state of the art RNN in 2022? I slightly doubt it a bit.
@codewithkarthik7136
@codewithkarthik7136 2 жыл бұрын
keith could you make a in-detail time series forecasting vid. It would be amazing
@SanataniAryavrat
@SanataniAryavrat 2 жыл бұрын
Glad you are back, Keith bro... all the best and love from India
@Sece1
@Sece1 2 жыл бұрын
I am new to ML and want to move forward wiith NLP. Really appreciate this. Can you also combine this with big data as in my project i was not able to use ngrams due to excessive column numbers. I used Yelp data. I also want to know about transformers and NLP with DL. Oh man there is a lot to cover!
@orlandmorentevlogs8360
@orlandmorentevlogs8360 2 жыл бұрын
Watching from Romblon Philippines.
@KeithGalli
@KeithGalli 2 жыл бұрын
Nice!!
@dheerajsharma1787
@dheerajsharma1787 4 ай бұрын
At 10:02 The get_feature_names() is now get_feature_names_out()
@kamilcopur6513
@kamilcopur6513 2 жыл бұрын
I've just decided to change my carreer path at my age 35. I have some basic knowledges about coding languages(C, Python, HTML,CSS, JS). But I still couldn't decide which area to choose. Normally I enjoy dealing with algorithms using python, but I am curious about job opportunities (especially for a starter after age 35).
@baozixiao6733
@baozixiao6733 2 жыл бұрын
exact same here. Struggled along the way but we only live once, so, do what we want to do!
@roibuda9448
@roibuda9448 2 жыл бұрын
my man
@ghzich017
@ghzich017 2 жыл бұрын
Hey bro, I really likes your tutorial. I wonder just by following your videos tutorial (like 95% of your tutorials videos) will ever get me a job in data science field without degree?
@arshad1781
@arshad1781 2 жыл бұрын
Thanks
@KeithGalli
@KeithGalli 2 жыл бұрын
You're welcome!
@technicalboy1816
@technicalboy1816 2 жыл бұрын
Thank you for this. Please make text bigger.
@TimGrob
@TimGrob Жыл бұрын
Please use List Comprehensions in Python in the future.
@vanhoumin
@vanhoumin 2 жыл бұрын
Damn I'm thinking of doing something NLP related for my thesis I guess this is the sign that I should do it 😅
@vanhoumin
@vanhoumin 2 жыл бұрын
I did it 😂
@aunterong6813
@aunterong6813 2 жыл бұрын
Hey Keith would you be doing a tutorial on regular expressions?
@KeithGalli
@KeithGalli 2 жыл бұрын
Not sure if you saw, but there is a small section on regular expressions in this video (look at the video timeline to find it). I definitely would like to make a more comprehensive video on regular expressions at some point. I find them super fun! haha
@TimGrob
@TimGrob Жыл бұрын
What exactly does the Bert Model do? Because you still feed the Bert Model output into an SVM to classify your text. Thanks for your explanation?
@mehdismaeili3743
@mehdismaeili3743 2 жыл бұрын
hi keith /thanks.
@shirumi2331
@shirumi2331 2 жыл бұрын
15:01 If anyone else is getting "CLOTHING" here, try creating your vectorizer like this: vectorizer = CountVectorizer(stop_words=["the"])
@sabbirahmed8012
@sabbirahmed8012 2 жыл бұрын
Hey Keith, Can you please mention some resources to learn nlp? TIA.
@berrodriquez26
@berrodriquez26 2 жыл бұрын
This guy deserves to be next to God !
@abhaytyagi762
@abhaytyagi762 3 ай бұрын
Hi Keith. Thanks for your tutorial, having a blast following along and learning! I've run into an issue, though. At time of writing (March 2024) spaCy seems to be on V3, and as a consequence to import BERT in we use spacy.load("en_core_web_trf") and NOT "en_trf_bertbaseuncased_lg", which does not work anymore. However, after doing so, it seems I'm running into an error regarding array sizes when fitting the SVC with my training vectors and train_y? Upon printing out train_x_vectors it displays empty arrays! That's probably why the fit isn't working. I'm not sure what's happening there (why are they empty??), could you help me out? Love from India.
@daikimochiron
@daikimochiron 3 ай бұрын
Up to this, I am encountering the same error.
@senthilkumarradhakrishnan744
@senthilkumarradhakrishnan744 2 ай бұрын
Are check and cheque meant to be similar?
@develxper7931
@develxper7931 2 жыл бұрын
11:57 keith enum 😂👌
@ramanjitsingh3683
@ramanjitsingh3683 4 ай бұрын
hi, @keithGalli, i need some help, can you please help me.. please answer my ques: i have 5 pdf's invoice with different format's i need to extract data from it but the position of data is all different from each other, i need to extract data from them i need to write python script so Machine learning authomatically extract data from it put into json format. do it possible with spacy? how i can do thta what technologies i will use to do it?
@thejaskp304
@thejaskp304 11 ай бұрын
When using trasformer architecture it gives me value error for using clf_svm.fit(train_x_vectors, train_y) and I dont know is this is because of 'en_core_web_trf' instead of 'en_trf_bertbaseuncased_lg' because of it was outdated in version3. can you clarify that why this give me value error?
@003kazimehrabrashid4
@003kazimehrabrashid4 4 ай бұрын
same case happened to me, were you able to solve this issue? if yes, can you please guide me?
@mohdfaazkhan8847
@mohdfaazkhan8847 2 жыл бұрын
Please create project "terms and conditions techniques" in NLP.
@KeithGalli
@KeithGalli 2 жыл бұрын
Hmm I don't know what you mean by this, can you please clarify
@saumojitbhattacharjee7292
@saumojitbhattacharjee7292 2 жыл бұрын
What Software You Use For Screen Recording?
@KeithGalli
@KeithGalli 2 жыл бұрын
When I recorded this I was using a program called Snagit. I more recently started using Bandicam. Note I record my screen and face separately and edit the two together after I'm done recording
@saumojitbhattacharjee7292
@saumojitbhattacharjee7292 2 жыл бұрын
@@KeithGalli Thanks 😊
@milomalaysia7034
@milomalaysia7034 3 ай бұрын
18:25
@Tommykennedy101
@Tommykennedy101 2 жыл бұрын
What happened to "Neuro Linguistic Programming"? Also did he put two finger's up to everyone at the start?
@timetostudy6443
@timetostudy6443 2 жыл бұрын
after trying out and nothing happened the way I want it to work. I quitted
@mr_m0u5e41
@mr_m0u5e41 2 жыл бұрын
I can always go to bed early tomorrow right? 👀
@KeithGalli
@KeithGalli 2 жыл бұрын
Haha I give you permission to get your sleep, the video will be here in the morning :)
@moviecamp11
@moviecamp11 2 жыл бұрын
Wait but what is language if not natural?? I’m pretty sure my dog can understand me, but he’s also an idiot. So what does that say about language?? Plz help Also I’m getting an error when I try to import beautifulsoup. It’s really harshing my mellow
@KeithGalli
@KeithGalli 2 жыл бұрын
That's an easy question, Mr. Sherwood. To find unnatural language all you have to do is watch me try to talk to girls at the bar. Hope this helps. Xoxo.
@fustigate8933
@fustigate8933 2 жыл бұрын
hi
@KeithGalli
@KeithGalli 2 жыл бұрын
Hello!
@BiranchiNarayanNayak
@BiranchiNarayanNayak 2 жыл бұрын
I find the words "Cheque" and "Check" are incorrectly used in the NLP examples. 39:52 "I went to the bank and wrote a check" is an incorrect English sentence. It should have been "I went to the bank and wrote a cheque" 1:54:41 "Write me a check" is an incorrect English sentence. It should have been "Write me a cheque".
@KeithGalli
@KeithGalli 2 жыл бұрын
In USA, we use "check" in this context. This may be untrue in other English speaking countries though.
@jorgeromero141
@jorgeromero141 Жыл бұрын
I love this guy in a non- homosexual way
@lbb2rfarangkiinok
@lbb2rfarangkiinok 2 жыл бұрын
NooMAREickle, not NOOmerical >)
@zachfornero9371
@zachfornero9371 Жыл бұрын
You sound like mordecai
@ToughdataTiktok
@ToughdataTiktok Жыл бұрын
Honored to learn nlp from elon musk himself
@bobbykbose4399
@bobbykbose4399 Жыл бұрын
Waste of time
Complete Regular Expressions Tutorial! (with exercises for practice)
1:19:21
What is NLP (Natural Language Processing)?
9:37
IBM Technology
Рет қаралды 212 М.
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 12 МЛН
Самое Романтичное Видео ❤️
00:16
Глеб Рандалайнен
Рет қаралды 6 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 274 М.
How I'd Learn AI (If I Had to Start Over)
15:04
Thu Vu data analytics
Рет қаралды 735 М.
Is Tree-based RAG Struggling? Not with Knowledge Graphs!
9:06
How I would learn Machine Learning (if I could start over)
7:43
AssemblyAI
Рет қаралды 746 М.
Modern Python logging
21:32
mCoding
Рет қаралды 160 М.
Unlocking your CPU cores in Python (multiprocessing)
12:16
mCoding
Рет қаралды 296 М.
Solving real world data science tasks with Python Pandas!
1:26:07
Keith Galli
Рет қаралды 1,5 МЛН