Up next


Generate Blog Posts with GPT2 Hugging Face Transformers | AI Text Generation GPT2-Large

2,633,665 Views
AI Lover
3
Published on 12/19/22 / In How-to & Learning

Writing blog posts and emails can be tough at the best of times.

TBH, some days just writing anything can be a struggle

I mean, right now, I'm struggling to write this description 😅

There's got to be a better way right?

Well, there is. Using the amazing AI power of GPT2 and Python you can generate your own blog posts using a technique called Text Generation. This can be extended out to a whole heap of different use cases, it could be used to write emails, poems, code. You name it, you could probably do it.

In this case, we're focused on blog posts though. You'll be able to pass through a simple sentence and have a whole chunk of text output that you can then use on your blog!

In this video, you'll learn how to:
1. Setting up Hugging Face Transformers to use GPT2-Large
2. Loading the GPT2 Model and Tokenizer
3. Encoding text into token format
4. Generating text using the GPT2 Model
5. Decoding output to generate blog posts

Get the code: https://github.com/nicknochnac....k/Generating-Blog-Po

Chapters:
0:00 - Start
3:34 - Installing Hugging Face Transformers with Python
4:03 - Importing GPT2
5:23 - Loading the GPT2-Large Model and Tokenizer
8:39 - Tokenizing Sentences for AI Text Generation
10:57 - Generating Text using GPT2-Large
11:50 - Decoding Generated Text
14:13 - Outputting Results to .txt files
16:11 - Generating Longer Blog Posts

Oh, and don't forget to connect with me!
LinkedIn: https://www.linkedin.com/in/nicholasrenotte
Facebook: https://www.facebook.com/nickrenotte/
GitHub: https://github.com/nicknochnack
Patreon: https://www.patreon.com/nicholasrenotte
Join the Discussion on Discord: https://discord.gg/mtTTwYkB29

Happy coding!
Nick

P.s. Let me know how you go and drop a comment if you need a hand!

Show more
0 Comments sort Sort By

Up next