A lightweight spam/ham text classifier for English messages, built with a
custom preprocessing pipeline (tokenization, stopword removal, lemmatization)
and TF-IDF features feeding into a Multinomial Naive Bayes classifier.
Binary spam classification for English text messages/emails. Part of a
multilingual spam detection system that automatically routes text to a
language-specific model (English or Arabic) based on detected language.
1import joblib
2
3model = joblib.load("spam_eng_nb.joblib")
4prediction = model.predict(["Congratulations! You've won a free prize, click here now"])
5print(prediction) # 1 = spam, 0 = ham