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.
- The bot loads Metro Health's page with weekly inspection roundups for a designated year.
- It compiles every weeks report into one annual report, sorts it by the inspection score, and drops everything but the ten worst.
- 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.
- 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.
- Finally, It writes everything out to a markdown file one by one.
- Clone this repo.
- Create a virtual environment.
- Install requirements.txt.
- Add
.env
file to your directory and plop in your OpenAI API key. - Run it:
python3 app.py
- 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.