Views
No views yet
1import joblib
2from huggingface_hub import hf_hub_download
3
4# Download model files
5model_path = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="model.pkl")
6vec_path = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="vectorizer.pkl")
7
8# Load
9model = joblib.load(model_path)
10vec = joblib.load(vec_path)
11
12# Predict
13text = ["Win a free iPhone now!!!"]
14result = model.predict(vec.transform(text))
15print(result) # ['spam']spam, not spam