← All projects

Project notes · Earlier learning

News Classifier API

An earlier project turning an AG News classifier into a validated HTTP service.

Problem & motivation

A saved classifier needs predictable inputs, outputs, and failure handling before another program can use it.

How it works

FastAPI serves a saved TF-IDF and logistic-regression model with Pydantic input validation, structured probabilities, basic rate limits, tests, and a Docker setup.

Evidence & limits

Serving the model does not improve its classification quality. It is limited to English news and can confuse Business with Technology or World. The former public Railway endpoint returned 404 in the October 2026 portfolio audit; use the repository’s local setup.

What I learned & next steps

I learned to test the service independently of the model. I would evaluate new article distributions before claiming the same performance beyond AG News.

Source & setup

See the repository README for installation, commands, and the underlying evidence.