Instructions to use saravananoeaxl/spam-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use saravananoeaxl/spam-detector with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("saravananoeaxl/spam-detector", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
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
- -