yhile-spam-lr-v1

Spam and scam text classifier

text-classifier License: MIT v1

About

yhile-spam-lr-v1 detects spam, phishing, and cryptocurrency scam messages, including giveaway scams, pig-butchering schemes, and wallet phishing. It is a scikit-learn logistic regression model over TF-IDF word and character n-grams, plus hand-built signals for URLs, crypto wallet addresses, urgency and money keywords, and scam categories.

Intended use

Flagging spam and scam messages in SMS and email text, as a small and inspectable baseline, and as a reference for building your own text classifier. The decision threshold is tuned for at least 95% precision to keep false alarms low.

Limitations

About 3.1 to 3.6% of legitimate messages are flagged as spam, and legitimate marketing and transactional email can share vocabulary with spam. AI-generated scam text is underrepresented in the training data, and the model reads one message at a time, without conversation history or email metadata. Wallet address checks validate the format only. English only.

Demo

Runs entirely in your browser. What you type is never uploaded or stored.

Try an example:
Result appears here.

A small, fast model: about 97% accurate on its test set, so it will still miss some scams and flag some real messages. It is not a security product.

Demo coming soon.

Details

ArchitectureLogistic regression (scikit-learn) on TF-IDF word 1-2-grams (8,000 features) and character 3-5-grams (4,000 features), plus engineered URL, wallet, keyword, and scam-category signals. Saved with skops.
Training dataAbout 41,000 deduplicated rows (59% legitimate, 41% spam): SMS Spam Collection, Enron-Spam, SpamAssassin public corpus, and about 65 handcrafted examples.
MetricsOn a 20% stratified test split (about 8,235 rows): accuracy 97.1%, ROC-AUC 0.995, spam precision 96%, spam recall 97%, false positive rate 3.1 to 3.6%.
LicenseMIT
File size9.0 MB (yhile-spam-lr-v1.skops)