SpamSentry

AI-powered SMS spam detector, by Vikranth Reddy

Try the live model

Type or paste a text message below. A real TF-IDF + Naive Bayes model, trained in Python, exported as weights, running 100% in your browser, judges it SPAM or HAM.

Try:
—
—

How it works

1. Data
216 labeled SMS messages (108 spam / 108 ham), generated from class-controlled templates.
2. Features
TF-IDF unigrams: each word weighted by how rare it is across messages.
3. Model
Multinomial Naive Bayes (scikit-learn): learns per-word spam/ham likelihoods. 5-fold CV accuracy: 100%.
4. Browser
weights.json (vocabulary + idf + priors + log-probabilities) is shipped to the site; JavaScript re-runs the exact same math as sklearn's predict_proba.

Tech stack

Python · scikit-learn · NumPy · vanilla JavaScript · static hosting (Vercel)

Files in this repo

train.py: trains the model and exports weights.json · index.html: this demo · vercel.json: security headers