Skip to content

This GPT-3-powered bot reads through San Antonio Metro Health restaurant inspections to simplify and rank observations made from the lowest-scoring restaurants and writes up a little article.

ryan-serpico/sa-restaurant-review-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github banner

Summary

Every six months the San Antonio Express-News does a roundup of the worst restaurant inspection reports from the Metropolitan Health District. You can see past stories here and here.

This bot automates the process of story creation.

How it works in plain english

  1. The bot loads Metro Health's page with weekly inspection roundups for a designated year.
  2. It compiles every weeks report into one annual report, sorts it by the inspection score, and drops everything but the ten worst.
  3. It then loads each reports inspection page, grabs basic info like the date of the inspection and the address of the restaurant, and, most importantly, what the inspectors observed during their review.
  4. It then slings those observations over to GPT-3, asking the LLM to simplify them as well as rank in terms of how gross they are. You can check out the prompt I'm using here.
  5. Finally, It writes everything out to a markdown file one by one.

Run it yourself

  1. Clone this repo.
  2. Create a virtual environment.
  3. Install requirements.txt.
  4. Add .env file to your directory and plop in your OpenAI API key.
  5. Run it: python3 app.py

Things to note

  • I, and you, do not blindly take these simplified and ranked observations and publish them without review. LLMs do not understand the truth. They hallucinate. In fact, I have seen this very bot hallucinate when there are not at least ten observations in the original inspection. So a human must be in the loop at all times.

About

This GPT-3-powered bot reads through San Antonio Metro Health restaurant inspections to simplify and rank observations made from the lowest-scoring restaurants and writes up a little article.

Topics

Resources

Stars

Watchers

Forks

Languages