Code: What makes drinkware buyers unhappy, and can an AI sort the reviews?
Every number on the case study page comes from these files. View any file in the browser, download one, or get them all as a zip.
| File | What it does | Open |
|---|---|---|
| analysis.py | The data checks, the two AI checks (stars, calibration), the routing rule and the brand comparison. Writes results.json. | View · Download |
| run_model.py | Asks the decision model (Laya) the typed questions for every review and saves its probabilities. | View · Download |
| llm_code.py | The codebook prompt Claude used to name the main complaint of each one- and two-star review, and a re-run. | View · Download |
| fetch_data.py | Streams the public Amazon Reviews 2023 files and draws the 2,000-review sample. | View · Download |
| build_page.py | Builds the case study page from results.json. | View · Download |
| results.json | Every number on the page. | View · Download |
| ai_answers.csv | The decision model's answers for every review (goes in data/). | View · Download |
| llm_complaints.csv | Claude's main complaint for each of the 300 one- and two-star reviews (goes in data/). | View · Download |
Download all (drinkware-reviews.zip)
Run it yourself
python3 fetch_data.py (streams 41 GB of public files; writes data/reviews.csv)- Put ai_answers.csv and llm_complaints.csv in data/ (the AI answers used on the page). To make new ones instead: pip install laya, then python3 run_model.py (about 40 minutes on a laptop processor) and python3 llm_code.py.
pip install pandas numpypython3 analysis.pypython3 build_page.py