This app periodically loads headlines from The Guardian and evaluates their sentiment using OpenAI's GPT-4 model.
It used to use GPT-3.5-turbo model but its results were not ideal. GPT-4 performs much better even though it is a bit pricier. To compensate for that we don't send article description anymore.
Since 2023-11-30 gpt-4-1106-preview
is used to save some bucks.
Based on jirihofman/nextjs-fullstack-app-template.
- make a page visually similar to The Guardian headline section and add sentiment emojis to it?
# Set initial categories for existing articles
set category:guardian:NEG1 8
set category:guardian:NEG2 5
set category:guardian:NEU 6
set category:guardian:POS1 1
set category:guardian:NEU 0
curl -XPOST https://sentiment-guardian.vercel.app/api/articles -d '{"adminApiKey":"ADMIN_API_KEY"}'
curl -XPOST https://sentiment-guardian.vercel.app/api/sentiment -d '{"adminApiKey":"ADMIN_API_KEY"}'