Ask W Narrow AI Demo [ Not AI ]
Spam Classifier - Trained in PHP, Running in JavaScript
Tool Scope
What this tool does: Runs a small neural network trained in PHP and executes it in your browser. Ten inputs, six hidden neurons, one output. Classifies a message as spam or not spam using seventy-three learned parameters.
What this tool does not do: Send your message anywhere, call any AI service, or act as a production spam filter. Everything runs locally in your browser.
1. Enter a Message
The network classifies only on ten vocabulary words: free, win, money, click, offer, meeting, project, report, hello, invoice. Any message without them will receive a near-neutral score.
2. Result
3. Neuron Breakdown
| Neuron | Activation | W2 weight | Contribution |
|---|
Positive contribution pushes the output toward SPAM. Negative contribution pushes it toward NOT SPAM. The neuron with the largest absolute contribution is the one that decided the result.
Disclaimer
This is a demonstration, not a production tool.
The network uses a ten-word vocabulary and six training examples. It is not a spam filter. Real spam filters train on millions of messages, use thousands of features, and combine the text signal with metadata such as sender reputation, link analysis, and header inspection.
A single typo defeats this network. "FREE M0NEY" will be scored as neutral because "m0ney" is not in the vocabulary. The network has no way to handle variations it has not seen.
The demo runs entirely in your browser. No data is sent to any server.
Architecture: Feedforward neural network. Ten inputs, six hidden neurons, one output neuron. Trained with hand-written backpropagation in PHP. Weights exported as JSON. Inference runs in vanilla JavaScript using the same forward propagation.
Read the full explanation: How Does AI Actually Work? A Hands-On Look at Training a Narrow AI From Scratch.
Verified 2026-10-07. The model and the inference code are both deterministic. Every prediction can be reproduced by hand.
Tool launched 2026-10-07. Last updated 2026-10-07.