Skip to content
All projects
newsclf results dashboard showing test accuracy, per-class F1 scores, serving latency, and the promotion gate rejecting a worse retrained candidate

Real-Time News Classifier

newsclf is a news topic classifier (TF-IDF + Logistic Regression over business, technology, sports, politics, health, entertainment, and science) served through FastAPI on a containerized AWS Lambda, with an hourly GitHub Actions workflow ingesting fresh articles from 22 RSS feeds and a weekly workflow retraining and gating the model. Every retrain trains a candidate and scores it against the currently deployed incumbent on the same fresh, never-seen holdout, only promoting it if it beats the incumbent by a configurable margin — the first real retrain scored a candidate at 0.516 macro F1 against the incumbent's 0.576, and the gate correctly rejected it, keeping the better model live. The deployed model serves at a 5.6ms warm p50 latency (benchmarked against a real uvicorn process, 200 requests) and reports live drift signals — out-of-vocabulary rate, population stability index, and rolling accuracy on genuinely unseen articles — so retraining is driven by measured language drift, not just a fixed schedule. All AWS access in CI runs through GitHub Actions OIDC role assumption with no long-lived credentials in repo secrets, and Terraform provisions the full stack (S3, ECR, Lambda, IAM, CloudWatch, and an ephemeral EC2 training instance that self-terminates after every run). One real bug caught along the way: the 'saga' solver is stochastic, and without a fixed random seed identical data produced different holdout accuracy on different runs (0.53 vs. 0.75) until it was pinned and verified deterministic. Backed by 39 tests, ruff and mypy clean — the Terraform is validated but not yet applied against live infrastructure, and the Lambda container image is written to spec but unbuilt, both flagged honestly rather than glossed over.

Pythonscikit-learnFastAPIMangumAWS LambdaAWS S3AWS EC2TerraformGitHub Actions