Photo by Joshua Sortino on Unsplash
Blokfeed Meet OpenAI (Quick Update)
Automating daily brief article summarization
A couple months ago I decided to update a few aspects of Blokfeed. A major aspect was adding article summarization for the daily brief articles. This is where I leaned on the OpenAI API to summarize articles.
Let me provide a bit of context. Blokfeed every day compiles a brief highlighting trending articles on the platform from that day. This is done by grouping articles by title and likes. But, it was always lacking.
What was lacking was a summary of an article that was part of a trending topic. Adding this functionality would allow users to more quickly get insights into what is happening in crypto. This provides a better user experience, by removing clicks and providing information to a user sooner.
Let's take a look at how I did it...
After I've compiled the trending topics, I pull an article for summarizing. I decided to use the completions
endpoint because it was straightforward to implement, and at the time chat
was in beta. Giving a simple prompt of Write a summary of the following article: <article_url>
resulted in a short summary I could save and add to the front-end.
In addition to adding this step, I updated the front-end to display the summary, and to provide the source article of the summary. The summaries aren't perfect, but now that we have chat
endpoints, I am going to soon switch over and hopefully, some of the small issues I am seeing are resolved.
Check out the Daily Briefs today!
Where have you implemented OpenAI? Let me know in the comments.
Happy coding