Part I — Markets and attention over time · Chapter 2
How Amazon's rating distribution changed
Within the same nine categories, weighted the same way every year, the share of 5-star Amazon reviews rose from 2010 to a 2019 peak and then fell in every one, mostly toward 1 star. Ratings did not inflate steadily; they moved to the extremes. Whether product turnover drives this is still open.
Star ratings are meant to say how good a product is, but a rating only means something next to the ratings around it. If most products get five stars, a 4.2 reads as a warning. Researchers have long argued that online ratings drift upward over time, so that a score from 2010 and one from 2020 are not on the same scale. This chapter checks that claim on the largest public set of Amazon reviews: are reviews in the same product categories more often 5-star than they used to be, how has the shape of the rating distribution changed, and do reviews from verified purchases rate differently?
The answer has two parts. Within the same 9 categories, weighted the same way every year, the share of 5-star reviews rose from 55.2% in 2010 to 69.7% in 2019, and it rose in all 9 of them. Then it fell, to 62.9% in 2022, in all 9. Most of the fall went to 1-star reviews, which made up 14.0% of all reviews in 2022 against 9.7% in 2019. The ratings did not inflate steadily. They piled up at the ends. Since an average can stay put while the middle empties, the sections below follow the whole distribution rather than a mean, then ask how much of the change comes from which products and purchases get reviewed.
Within the same categories, 5-star reviews rose until 2019, then fell in every one
Querychapters/08-review-ratings/pipeline/20_model.sqlShow SQL
-- Categories with at least 1,000 reviews in every year from 2000 to 2022.
CREATE OR REPLACE TABLE steady AS
SELECT category FROM cat_year
WHERE year BETWEEN 2000 AND 2022 AND reviews >= 1000
GROUP BY category HAVING count(*) = 23;
-- Each one's weight: its share of all their reviews over the whole window, the same every year.
CREATE OR REPLACE TABLE weights AS
SELECT category, sum(reviews) / sum(sum(reviews)) OVER () AS w
FROM cat_year JOIN steady USING (category)
WHERE year BETWEEN 2000 AND 2022 GROUP BY category;
CREATE OR REPLACE TABLE trend AS
SELECT c.year,
sum(c.share_5 * c.reviews) / sum(c.reviews) AS pooled_share_5,
sum(c.share_5 * w.w) FILTER (WHERE w.w IS NOT NULL) AS within_share_5
FROM cat_year c LEFT JOIN weights w USING (category)
WHERE c.year BETWEEN 2000 AND 2022 GROUP BY c.year;23 yearsRuns at build time in DuckDB 2.0; shown for reading.Open file
What the reviews cover
The dataset has one file per Amazon top-level category, 33 of them plus one called Unknown for products whose category the crawl could not tell. They range from 16,216 reviews (Subscription Boxes) to 67,409,944 (Home and Kitchen). Each line is one review in JSON. The stage reads five fields and leaves out the review text, the title, the images and the reviewer ID, so nothing kept identifies anyone.
Most of the reviews are recent: 278,742,464 of them were written from 2019 to 2022, against 2,418,972 in all of 2010. Any chart of all reviews pooled is mostly a chart of the last few years and of the categories that grew fastest, which is why the hero holds the categories and their weights fixed.
| Home and Kitchen | 67,409,944 | 67.4M | 3,734,414 | 1998-05 | 2023-09 | yes |
| Clothing Shoes and Jewelry | 66,033,346 | 66.0M | 7,216,886 | 1998-07 | 2023-09 | — |
| Unknown | 63,814,110 | 63.8M | 13,190,699 | 1996-11 | 2023-09 | yes |
| Electronics | 43,886,944 | 43.9M | 1,609,860 | 1996-11 | 2023-09 | yes |
| Books | 29,475,453 | 29.5M | 4,446,065 | 1996-06 | 2023-09 | yes |
| Tools and Home Improvement | 26,982,256 | 27.0M | 1,473,605 | 1999-02 | 2023-09 | yes |
| Health and Household | 25,631,345 | 25.6M | 797,393 | 1999-08 | 2023-09 | — |
| Kindle Store | 25,577,616 | 25.6M | 1,590,697 | 1999-08 | 2023-09 | — |
| Beauty and Personal Care | 23,911,390 | 23.9M | 1,028,731 | 2000-04 | 2023-09 | — |
| Cell Phones and Accessories | 20,812,945 | 20.8M | 1,288,441 | 1998-02 | 2023-09 | — |
| Automotive | 19,955,450 | 20.0M | 2,003,039 | 1998-01 | 2023-09 | — |
| Sports and Outdoors | 19,595,170 | 19.6M | 1,587,219 | 2000-05 | 2023-09 | — |
The distribution emptied in the middle, then filled at 1 star
Online ratings are usually J-shaped: many 5-star reviews, some 1-star, few in between. Amazon's ratings got more so. In 2005, 20.6% of reviews gave 4 stars; by 2019 it was 10.7%, and 5 stars had taken the difference. After 2019 the left end grew instead.
Fewer reviews in the middle, then more at 1 star
2005
| 1 | 9.0% |
|---|---|
| 2 | 6.1% |
| 3 | 9.7% |
| 4 | 20.6% |
| 5 | 54.5% |
2012
| 1 | 8.6% |
|---|---|
| 2 | 5.3% |
| 3 | 8.4% |
| 4 | 18.6% |
| 5 | 59.1% |
2019
| 1 | 9.7% |
|---|---|
| 2 | 4.2% |
| 3 | 5.9% |
| 4 | 10.7% |
| 5 | 69.5% |
2022
| 1 | 14.0% |
|---|---|
| 2 | 5.7% |
| 3 | 7.4% |
| 4 | 10.4% |
| 5 | 62.5% |
Mixing in more categories over time does not explain the rise. Pooled across all categories, the 5-star share in 2019 was 69.5%, almost the same as the fixed-weight figure of 69.7%. The two differ more before 2010, when the categories that dominate now, such as Home and Kitchen, had few reviews: in 2004, 54.9% pooled against 50.4% fixed-weight.
Verified reviews lost their lead and became the more negative
Amazon marks a review as a verified purchase when the reviewer bought the item on Amazon and did not get it at a deep discount. For most of the period, verified reviews were the more generous ones: in 2015, 65.3% of verified reviews gave 5 stars against 60.6% of the others. By 2022 the gap had gone: 62.5% against 62.7%, and verified reviews were the more likely to give 1 star, 14.5% against 9.5%.
Verified reviews lost their lead in 5-star share and became the more negative
5 stars
1 star
Verified against unverified, pooled and by category in one passchapters/08-review-ratings/pipeline/20_model.sqlShow SQL
CREATE OR REPLACE TABLE verified_year AS
SELECT category, year, verified, sum(t.reviews) AS reviews,
sum(t.reviews) FILTER (WHERE rating = 5) / sum(t.reviews) AS share_5,
sum(t.reviews) FILTER (WHERE rating = 1) / sum(t.reviews) AS share_1
FROM ratings t
GROUP BY GROUPING SETS ((category, year, verified), (year, verified));
-- The (year, verified) set gives the pooled rows, with category NULL.Runs at build time in DuckDB 2.0; shown for reading.Open file
Which products get reviewed: what the cohort split can and cannot show
If products that stay on sale collect better reviews over time, perhaps because the bad ones are delisted, the 5-star share could rise without any single product's ratings changing. The stage splits each year's reviews by whether the product got its first review that year. The two groups differ by a few points but rise and fall together: in 2019, 67.5% of reviews of new products gave 5 stars against 70.2% for products reviewed before, and in 2022, 63.8% against 62.2%. That rules out one narrow story: the peak is not simply new listings arriving with better reviews than old ones. It does not rule out survival. "Returning" products in 2022 are not the same products as in 2015, and the split holds neither which products are in each group nor how many reviews each contributes. If weak products were delisted, the returning group would improve without any product's ratings changing, and this split would not show it.
To settle that needs a product-by-year panel: a fixed set of products followed across years, with stated rules for entry, exit and a minimum number of reviews. The published aggregates cannot recover product histories, so that panel means a new stage that keeps a stable product identifier. Even then a balanced panel is selected on survival, and should be described that way. Until it is built, read the rise and fall as a change in the reviews Amazon shows, not in how buyers rate a given product.
How the pipeline reduces 571 million reviews
The work splits in two. A stage reads each category's file once and reduces it to five small Parquet tables of counts. That is the only step that touches the 275 GB, and it ran on Cloud Run as eight tasks at once. Everything after it reads those tables, a few megabytes in all, and runs on a laptop in seconds.
Download each file once, in chunks
DuckDB can read JSON from standard input, but on a pipe it keeps the whole input in memory, and the largest file is 31 GB. A short Python script cuts the download into chunks of about 1 GB of whole lines, writes each to a file, and appends it to a table in a DuckDB database file.
stream.pySQL -- load.sql, run once per chunk against the category's database file. INSERT INTO r SELECT rating::TINYINT, epoch_ms("timestamp"), verified_purchase, helpful_vote, parent_asin FROM read_json(getvariable('src'), format = 'newline_delimited', columns = {rating: 'DOUBLE', "timestamp": 'BIGINT', verified_purchase: 'BOOLEAN', helpful_vote: 'BIGINT', parent_asin: 'VARCHAR'});Naming the columns tells
read_jsonwhich fields to build; the rest of each line is skipped without being parsed into values.34 files, 275 GBchapters/08-review-ratings/stage/stream.py
Reduce each category to counts
Reviews by year, star and verified flag; reviews and distinct products per year; reviews by the year a product was first reviewed; a sample; and one row of totals for the checks. Distinct products per year use
approx_count_distinct, a HyperLogLog sketch, because exact distinct counts for the largest categories would hold millions of product IDs per year in memory.stage.sqlSQL COPY ( SELECT getvariable('cat') AS category, year(ts)::INT AS year, rating, verified, count(*) AS reviews, count(*) FILTER (WHERE helpful_vote > 0) AS with_helpful_vote FROM r GROUP BY ALL ORDER BY ALL ) TO (getvariable('out') || '/ratings.parquet') (FORMAT parquet); COPY ( SELECT getvariable('cat') AS category, year(ts)::INT AS year, rating, verified, helpful_vote FROM r USING SAMPLE reservoir(20000 ROWS) REPEATABLE (8) ) TO (getvariable('out') || '/sample.parquet') (FORMAT parquet);Five Parquet tables per categorychapters/08-review-ratings/stage/stage.sql
Gather, model and check
read_parquetwith a**glob gathers every category's tables, wherever the Cloud Run task put them. The model computes star shares by category and year, the fixed-weight average in the hero, verified against unverified, and new against returning products.checks.sqlstops the run if any category's review count differs from the dataset card, if a rating falls outside 0 to 5, or if the tables do not add up.Seconds on a laptopchapters/08-review-ratings/pipeline/20_model.sql
The reservoir sample is the chapter's small, row-level tier: 20,000 reviews per category, with no IDs or text. In every category with that many reviews, its 5-star share is within 0.6 points of the exact share, close enough for exploring the data interactively but not for the figures, which all use the exact counts.
Reusing the approach
# Stage: per category, on Cloud Run with --tasks 8
bash chapters/08-review-ratings/stage/run.sh
# Everything after the stage, locally
bash chapters/08-review-ratings/pipeline/run.shA source too big for one machine's memory still fits a simple plan: reduce each part to counts at the grain the questions need, once, and keep those small tables. Here the grain is category × year × star × verified flag, and every figure, check and caveat above comes from tables of that kind. When a question changes, the model and the page rerun in seconds; only a new grain needs the 275 GB again. Full pipeline: chapters/08-review-ratings.