Maya Akim Profile picture
Testing AI tools and having fun I like to talk about AI here: https://t.co/RRNfWi6Aod

Jun 11, 2023, 11 tweets

Just 3 months into learning Python, I've built my second functioning app.

Thanks to my favorite tutor - @OpenAI's GPT4 and the best Python framework @LangChainAI

This time I created a tool that I dreamt of for a long time, a fully customizable, personalized newsletter 🗞️

The tool - "AutoGNT", lets you type a keyword, and within a minute, you'll receive an email with summarized news articles related to your input.

After all, we should control our news consumption, not the other way around.

First, I asked GPT4 to write a script that calls @serp_api and returns a list of URLs based on the user’s input.

It performed well, but there was a problem - duplicate news topics!

But that's how the media works, every news publisher will write their own version of the news.

So, I used @scikit_learn (helped by chatGPT) to group similar articles and discard duplicate topics.

By comparing article content, the script would reject one and keep the other if they were too alike.

Next, I used newspaper3K to scrape the content of the news article.

It's incredibly beginner-friendly and I didn't need to rely on GPT4 due to its clear documentation.

Then, I integrated LangChain for:

1. Summarizing articles
2. Ensuring summarized text < 4000 tokens using text splitters
3. Generating catchy titles with prompt templates.

It’s a new tool, GPT doesn't know it so I wrote 100% of the code on my own and it was a good practice.

The final step was setting up an email service with @Mail_Gun to send the content as an email.

With the MailGun docs, this script was easy to implement even as a total beginner.

If you'd like to learn how to recreate this tool, you can check out my latest video ⤵️

Or check out the code here ⤵️

github.com/majacinka/auto…

And lastly, I used @streamlit for frontend, testing, and hosting

…inka-autognt-app-cruudz.streamlit.app

I'm sharing my process to encourage more people, even beginners, to learn programming and create tools that currently don't exist.

ChatGPT is making learning programming so much less intimidating so let's seize this opportunity 🍀

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling