Natural language processing / Classification

Read the signal.
Understand the label.

Try a text classifier and inspect the words that influence its score. Built from short-message data with reproducible preprocessing and an honest evaluation.

INBOXLENS / RESEARCH NOTEBOOK01 — EXPLORATION
TOKENS → TF–IDF → NAIVE BAYES
By SOLANKYYYInteractive project showcase
5,574Raw SMS records
5,159After text deduplication
TF–IDFText representation
LocalBrowser inference
01 / Try it yourself

A message, explained.

Try an example or type a short message. Text is processed locally and is not sent to a server.

Try a short message

No network request or message storage. Maximum 5,000 characters.
TF–IDF + Multinomial NB

Orange words move the score toward spam; green words move it toward ham. “Not flagged” does not establish safety.

02 / Evidence & context

Know the data behind it.

Dataset facts, evaluation conditions and limitations are part of the project.

03 / Under the surface

A clear path from input to output.

01 / CLEAN

Clean

Read the headerless tab-separated dataset correctly. Normalize message keys and deduplicate before splitting.

02 / TRAIN

Train

Fit TF–IDF with English stopwords on the training data only, then train Multinomial Naive Bayes.

03 / INSPECT

Inspect

The browser reconstructs TF–IDF and NB scores. Token contributions describe model behavior; they are not proof that a message is harmful.

04 / Read before interpreting

Questions worth asking.

Is this trained on email?

The file contains labelled SMS messages. The original repository name says email, but email-specific performance has not been evaluated.

Does “not flagged” mean a message is safe?

No. A classifier can miss spam and cannot verify links, senders or attachments. Unknown vocabulary is explicitly identified instead of presented as a reliable verdict.

How was leakage reduced?

Messages are lowercased and trimmed for duplicate detection before a stratified 80/20 split. Near-duplicates may remain. Evaluation covers this dataset, not modern or multilingual messaging.