AI Text Summarization with Hugging Face Transformers in 4 Lines of Python

  Рет қаралды 58,322

Nicholas Renotte

Nicholas Renotte

Күн бұрын

There’s sooo much content to take in these days.
Blog posts coming out left, right and centre.
KZfaq videos to watch
Podcasts to listen to.
Don’t you sometimes wish you could just get a summary of them all?
Well, you can!
Using Hugging Face Transformers you can leverage a pre-trained summarisation pipeline to start summarising content. In fact in just 4 lines of Python code you can begin to summarise blog posts. It’s ridiculously easy to get started with and the fun just begins there, there’s so much more stuff you can do with the Hugging Face Transformers library!
In this video you'll go through:
1. Installing Hugging Face Transformers
2. Building a summarization pipeline
3. Running an encoding decoding model for summarization
Get the CODE: github.com/nicknochnack/Huggi...
Chapters
0:00 - Start
1:09 - Installing Hugging Face Transformers
3:12 - Loading the Summarization Pipeline
4:20 - Generating a Summary
Oh, and don't forget to connect with me!
LinkedIn: / nicholasrenotte
Facebook: / nickrenotte
GitHub: github.com/nicknochnack
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand!

Пікірлер: 124
@seanmackenziedataengineering
@seanmackenziedataengineering 3 жыл бұрын
That was great! Amazing what you can do with these libraries. Thanks for the cool vid!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Oh it is RIDICULOUSLY cool! Cheers @Sean!
@camelion14
@camelion14 10 күн бұрын
Thanks man, it was a great video and a great learning process I've faced more issues with python on the compatibility of the libs, and that I think is what makes these nice projects more difficult to leave with. Thanks man, wish you luck and success.
@diegoescalante6124
@diegoescalante6124 3 жыл бұрын
Bro, you are so underrated. Keep up the great work!!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Diego! Plenty more to come!
@nargessheydari9799
@nargessheydari9799 Жыл бұрын
Very clear and effective. Thanks!
@kenchang3456
@kenchang3456 2 жыл бұрын
Another great video, thanks! I just started watching a Hugging Face course on their KZfaq channel. Best regards.
@SantiTonelli72
@SantiTonelli72 9 ай бұрын
Wowwww Nicholas !!!!! Thanks for giving me My First Transformer NLP shot!
@saraswathichandrasekaran9541
@saraswathichandrasekaran9541 Жыл бұрын
Hey Nick, is there a way I can have a t5 model to output certain number of sentences in my summary?
@shreyajayant2504
@shreyajayant2504 2 жыл бұрын
Thanks a lot Nicholas, it really helped me out!
@ndanjikalokoni4575
@ndanjikalokoni4575 2 жыл бұрын
I love you man !! You're really what I need at this point in my life. Sending you love from Zambia (Africa). You're International Bro !!!
@NicholasRenotte
@NicholasRenotte 2 жыл бұрын
Much love 🙏!!
@IrfanShaikh-ib4xt
@IrfanShaikh-ib4xt 2 жыл бұрын
Hi Nicolas as you mentioned how can we summarise text from a longer blog post or longer article ,can you please help with that
@sandymlgenai
@sandymlgenai Жыл бұрын
I'm trying to implement and compare BART, T5, PEGASUS AND ASGARD.Can I import the modules directly into my collab notebook?
@yasminesmida2585
@yasminesmida2585 16 күн бұрын
which SLM you would recommend for handling summaries in both English and French .thank you
@UsmanNiazi
@UsmanNiazi 3 жыл бұрын
Love the Energy Man !
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks a bunch @Usman! Gotta bring it!
@zack2767
@zack2767 2 ай бұрын
Hello bro , I am a student and I usually just highlight the text I need to study from my pdf folders , is there anyway that there are any AI that takes what highlighted and just copy paste it to another folder ? I have been searching but couldn't find anything like that , only general summery
@Rahul-kl1hm
@Rahul-kl1hm 2 жыл бұрын
Can I apply the same technique to summarize a resume? (I'd first extract the text off the resume)
@shakhauathasan9555
@shakhauathasan9555 2 жыл бұрын
Great explanation. Some times small can make understand a lot.
@MM-qq6xp
@MM-qq6xp 3 жыл бұрын
Before even I watch your video, I click on like. Your videos are shockingly underrated. Good luck. Wanna hear you more, bro.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Hmmm, didn't look into this. Just the default for Python, the doco isn't really explicit about which model is loaded.
@riser9644
@riser9644 Жыл бұрын
how to do the same with long texts getting error : Token indices sequence length is longer than the specified maximum sequence length for this model
@laythqureshi5917
@laythqureshi5917 Жыл бұрын
Would you be able to do a video on how you can use this to summarise much larger texts? Or would there be a different NLP which is more suited to extremely large-scale text summary and synthesising?
@G4J
@G4J 11 ай бұрын
Have u found anything? I Need to summarize a 70,000 character text documment for school, not even in english its in a diff language.
@joesworld5789
@joesworld5789 Жыл бұрын
Your videos are so great. After I saw hugging face on one of your videos I dove in head first. I have watched all their tutorials. I want to train my own model from a very large book. I am confused on how to do this. They give examples how to train a model using their data sets. I want to create my own data set from text then train the model and test it. If you could make a video on how this is done would be amazing!!!
@luvbhandari1
@luvbhandari1 Жыл бұрын
The code from GitHub did not work, getting errors when I run the code for text summarization
@vincent_hall
@vincent_hall 3 ай бұрын
Excellent tools. Thanks for this. and thanks to Hugging Face.🤗
@vishnuprasad3100
@vishnuprasad3100 2 жыл бұрын
Very useful tutorial thanks
@poojaholkarS
@poojaholkarS 3 жыл бұрын
Hey, I get this " IndexError: index out of range in self" error while implementation . Any clue on this?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Pooja, can you share the full error?
@datasci4547
@datasci4547 3 жыл бұрын
Great tutorial. Thank you!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Data Sci!
@luis96xd
@luis96xd 2 жыл бұрын
How can I use this summarization model or Distill BERT from Hugging Face as a tensorflow model? I want to train them, fine tune it and then save them for using as a web service? How can I do this, train on colab, infer in a web app?
@NicholasRenotte
@NicholasRenotte 2 жыл бұрын
Haven't tried as of yet but AFAIK, it's intended to be used through the HF API.
@adit_ii
@adit_ii 3 ай бұрын
hey nicholas, i have been following your videos for learning. i am currently developing a autograder tool using bert QA model and i really need your guidance. pls do reply since this is my final year project and i am totally stuck
@mertceylan6462
@mertceylan6462 Жыл бұрын
thank you Nicholas !
@konradriedel4853
@konradriedel4853 3 жыл бұрын
Great content, one question right now: does the huggingface library also work with other languages french german etc?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Sure does @Konrad, there a bunch of languages available depending on what you're looking to do. Can even translate first then apply summarization!
@Alpacastan21m
@Alpacastan21m 3 жыл бұрын
The summarizer did not work for some reason, returned text as is. What would be the possible issue?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
How much text did you pass through? Can you try with an alternate block?
@jeremyravenel2986
@jeremyravenel2986 2 жыл бұрын
Very good video ! Thanks 🙏
@NicholasRenotte
@NicholasRenotte 2 жыл бұрын
Thanks a million @Jeremy!
@debatradas9268
@debatradas9268 2 жыл бұрын
thank you very much
@Acer3859
@Acer3859 Жыл бұрын
Thanks for the great post Nick. Is it free to use the Hugging Face pipeline? For future videos, it will be great if you can: 1. Do longer texts 2. Summarize a webpage 3. Summarize a PDF
@sukanyasargunar4480
@sukanyasargunar4480 2 жыл бұрын
Tutorial is awesome,easy to understand..Can u give handson session for domain specific summarisation
@nuzhatraisa1330
@nuzhatraisa1330 2 жыл бұрын
Can we do text generator using hugging face transformer?If yes..how?
@Santoshsusarla
@Santoshsusarla 2 жыл бұрын
thanks!
@mohammadzain7726
@mohammadzain7726 3 жыл бұрын
hi, i want to know if theres a translator which we can use. Could you make a quick tutorial on that? need to translate from arabic to english and need to do it offline
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Check this out: kzfaq.info/get/bejne/nMtxYKtnx9Lbomg.html
@generichuman_
@generichuman_ Жыл бұрын
It seems like this model is just doing extraction (pulling out exact sentences that exist in the article). I'd like to compare it with much simpler tf-idf (term frequency inverse document frequency) models to see if it performs any better. I assumed a model using large pretrained transformers would do some form of abstraction and paraphrasing of the output. Maybe I'm expecting too much, but what this model is doing seems very very simple.
@alx8439
@alx8439 Жыл бұрын
If my memory serves me well, there're two generic approaches for text summarization - an extraction and a generation. This one definitely does the first thing
@ryanenigma3546
@ryanenigma3546 2 жыл бұрын
How can we summarize something longer maybe a classroom lecture video ?
@dipanshuhaldar7347
@dipanshuhaldar7347 2 жыл бұрын
I would love to see some content on how to train the transformer summarization pipeline
@LaoZhang00
@LaoZhang00 2 жыл бұрын
Could you do a video on creating a chat bot. using the hugging face transformers?
@user-in4gh3df9o
@user-in4gh3df9o 9 ай бұрын
Is it Abstractive Summarizer?
@rickyS-D76
@rickyS-D76 3 жыл бұрын
Great video...is there any Swedish language model that can be used for the same purpose?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Couldn't find an explicit summarization model but you might be able to pass one of these to a summarization pipeline: huggingface.co/models?search=swedish
@ibrahimisrafilov1248
@ibrahimisrafilov1248 3 жыл бұрын
Only 905 views? Man, you deserve 905k. Btw, are there any italian language model that can I use?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Amen to that 🤣! Definitely, check this out huggingface.co/neuraly/bert-base-italian-cased-sentiment
@willcline9404
@willcline9404 3 жыл бұрын
When I run summarizer I get the error: "index out of range in self." Anyone know what the deelio is?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
How long is the text you're passing through? Normally this pops up if your input length is too long.
@willcline9404
@willcline9404 3 жыл бұрын
@@NicholasRenotte yeah that’s what it was. It was too long. Not sure exactly what the limit is
@Juligames263
@Juligames263 2 жыл бұрын
Great tutorial, thanks! Can you please explain how can we summarize long text with transformers?
@NicholasRenotte
@NicholasRenotte 2 жыл бұрын
Check this out: kzfaq.info/get/bejne/gMmkoNGU373LYIk.html
@learntoday8857
@learntoday8857 3 жыл бұрын
That's nice. Thanks for sharing. I've been using gpt3 for a couple of months now, but not being able to fine tune it is a pain in the neck.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Ya, I think a lot of people are turning to GPT2 or GPT Neo and fine tuning using those models which ideally results in good results for that particular context!
@nesrinebouazizi8442
@nesrinebouazizi8442 3 жыл бұрын
hi where you able to fine tune gpt2 using hugging face ?
@dheerajnaik2066
@dheerajnaik2066 2 жыл бұрын
I was looking for a way to summarize text in different languages apart from english. If you could make a video on this, it would be of a really great help.
@vinaceparamanantham2955
@vinaceparamanantham2955 Жыл бұрын
what about extractive summarization
@johnbuell8035
@johnbuell8035 2 жыл бұрын
I’d like to see the video you mention, about summarizing a larger article.
@anandamon9351
@anandamon9351 Жыл бұрын
Doesn't work for longer texts.
@robertc6343
@robertc6343 3 жыл бұрын
This was cool👍🏻 and I need to summarize my 10-page long research experience document into a one, max two page resume. It seems HuggingFace might help me with that😜 How about GPT3? Have you seen it being used for such tasks, Nick?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Robert, definitely got a GPT3 clone good to go for a video soon as well! BTW, if you have a long document to summarize, check this out: kzfaq.info/get/bejne/gMmkoNGU373LYIk.html
@robertc6343
@robertc6343 3 жыл бұрын
@@NicholasRenotte Yes! Thank you.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@robertc6343 anytime, let me know how you go!
@johnpaulson5706
@johnpaulson5706 3 жыл бұрын
Really interested to know what should be done for larger amounts of texts. Also can it be used to generate text..like say a poem.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Got text generation planned already @John, was hoping someone would ask! Code is good to go, vid should be out this week. Will get something together for large scale summarization.
@diegocaumont5677
@diegocaumont5677 3 жыл бұрын
@@NicholasRenotte Using GPT-2?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Yup!! Wish I had access to GPT3 but haven’t chased up my api request and cbbd waiting for it.
@diegocaumont5677
@diegocaumont5677 3 жыл бұрын
@@NicholasRenotte Dopee. Yea I tried gaining access to it as well but no reply. Can't wait for your video.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@Diego Caumont yeah seems like a massive pain to get access, might need to start hassling them on Twitter 😂Should be out this week!
@thenukaperera4409
@thenukaperera4409 3 жыл бұрын
Maybe a video on how to finetune/train with your own dataset one of the 3 most downloaded summarization models in HuggingFace. Amazing video :)
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Yah, wayyy more stuff on Hugging Face coming! First one's up this week including some GPT2 stuff!
@testingemailstestingemails4245
@testingemailstestingemails4245 2 жыл бұрын
how to do that trained huggingface model on my own dataset? how i can start ? i don't know the structure of the dataset? help.. very help how I store voice and how to lik with its text how to orgnize that I an looking for any one help me in this planet Should I look for the answer in Mars?
@zeroranger
@zeroranger 2 жыл бұрын
Is there a lesson on how to implement a transformer summarizator from scratch?
@NicholasRenotte
@NicholasRenotte 2 жыл бұрын
Not yet 😉!
@zeroranger
@zeroranger 2 жыл бұрын
@@NicholasRenotte 😱😱 help!
@floyd1411
@floyd1411 Жыл бұрын
is this still applicabled even today Feb 2023?
@abhit007
@abhit007 3 жыл бұрын
How to summarize a huge document spanning 50-100 pages?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Check this out @Abhishek: kzfaq.info/get/bejne/gMmkoNGU373LYIk.html
@JayStiqs
@JayStiqs 2 жыл бұрын
Please make a youtube title generator (from a keyword or list of keywords).
@kirtipandya4618
@kirtipandya4618 3 жыл бұрын
It would be great if you can also show how can we do it for longer text. Thank you very much for great video
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Definitely, got you covered, check this out @Kirti: kzfaq.info/get/bejne/gMmkoNGU373LYIk.html
@kapilbhise8273
@kapilbhise8273 3 жыл бұрын
How should I learn Machine learning?
@kapilbhise8273
@kapilbhise8273 3 жыл бұрын
Please reply
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Kapil, check this out for some pointers: kzfaq.info/get/bejne/eJuVoKadtszDeWg.html
@dragonking6990
@dragonking6990 3 жыл бұрын
Can we do text paraphrasing using AI,,,if so please make some Vedio how to paraphrase a paper using AI
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Hmm, let me dig into it!
@prasadmadusanka3960
@prasadmadusanka3960 3 жыл бұрын
Heyy. Can you please create a video to explain how to use Neural Network to find patterns from large datasets. if you can please create a video ASAP. 🙏
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Prasad, you probably don't need a neural network for that. Try using Exploratory Data Analysis to find some patterns, I cover it in the first couple of videos in the Full Stack ML Playlist: kzfaq.info/sun/PLgNJO2hghbmjNrHZqplNMEpsW-QLFdvJV
@pranshuagrawal3648
@pranshuagrawal3648 3 жыл бұрын
hi.. can you please help me with huge data.. like around 5 lakh words and the summary should be meaningful
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Pranshu, take a look at this, supports long documents using chunking: kzfaq.info/get/bejne/gMmkoNGU373LYIk.html
@rameshbunga4891
@rameshbunga4891 3 жыл бұрын
Please create a video on read text from image
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Done, check out OCR: kzfaq.info/get/bejne/kLx7lLqBvJ_TgY0.html
@captainng97
@captainng97 3 жыл бұрын
Hi, this is Abstractive or Extractive?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
I believe it's extractive from looking at the outputs @Ng, however the documentation doesn't explicitly say. I've got a tutorial planned for Abstractive soon!
@captainng97
@captainng97 3 жыл бұрын
Ahh pls do so, waiting for it haha! :)
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@captainng97 you got it! I'm kinda excited to do it as well 😊 such a cool space!
@captainng97
@captainng97 3 жыл бұрын
@@NicholasRenotte Okie, pls do let me know once it's out! :D
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@captainng97 definitely, will do!
@litttlemooncream5049
@litttlemooncream5049 4 ай бұрын
tried on chinese...not quite satisfying...😭but still thanks for the help!
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
How to Summarize Text Using Python and Machine Learning
22:25
HuggingFace Crash Course - Sentiment Analysis, Model Hub, Fine Tuning
38:12
Summarizing legal documents with Hugging Face and Amazon SageMaker
21:55
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 88 М.
ноутбуки от 7.900 в тг laptopshoptop
0:14
Ноутбуковая лавка
Рет қаралды 3,5 МЛН
Опасность фирменной зарядки Apple
0:57
SuperCrastan
Рет қаралды 12 МЛН