A tracker for how New Zealand's news media covers each political party in the run-up to the 2026 general election. It scrapes the major NZ outlets every two hours, scores the tone of each article toward every party, and charts the results over time.

Quartz runs the pipeline every two hours. The scraper pulls articles from eleven NZ outlets, including RNZ, Stuff, NZ Herald, The Spinoff and Newsroom, through a mix of RSS and HTML scraping. Duplicate URLs are skipped, so the job is safe to rerun.
Each article gets two scores. The first comes from a hand-built dictionary of weighted sentiment words with negation and intensifiers, so 'not praised' flips negative and 'strongly praised' scores higher than 'praised'. The second comes from a RoBERTa sentiment model running in-process with ONNX Runtime. It started on the HuggingFace API, and I tried FinBERT for a few months before going back to RoBERTa, because FinBERT read most political text as neutral. When the free API allowance ran out in October, I moved the model in-process. The two scores blend 65% model, 35% dictionary.
Scores are worked out per party, not per article. Only the sentences that mention a party count as evidence about it, and in a sentence like 'National slams Labour' the evidence goes against Labour, not National. Party and politician names are matched with word-boundary regex, which stops 'national park' counting as the National Party or 'green energy' as the Greens.
Opinion pieces, columns and poll stories are filtered out, because their tone belongs to the writer or the public rather than the coverage. The frontend shows a 7-day average per party with election events marked on the timeline, the latest score for each party, and a week-by-week heatmap. Once collection ends, a script downloads every chart's data into static JSON so the backend can be shut down and the site keeps working.
