Spam Detector

A simple spam email classifier built with scikit-learn.

How to use

import joblib
from huggingface_hub import hf_hub_download

# Download model files
model_path = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="model.pkl")
vec_path   = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="vectorizer.pkl")

# Load
model = joblib.load(model_path)
vec   = joblib.load(vec_path)

# Predict
text   = ["Win a free iPhone now!!!"]
result = model.predict(vec.transform(text))
print(result)  # ['spam']

Model details

  • Algorithm: Logistic Regression
  • Features: CountVectorizer (bag of words)
  • Labels: spam, not spam
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support