saravananoeaxl commited on
Commit
ff5dcf7
·
verified ·
1 Parent(s): 18999bf

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +38 -0
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - text-classification
5
+ - spam-detection
6
+ - sklearn
7
+ license: mit
8
+ ---
9
+
10
+ # Spam Detector
11
+
12
+ A simple spam email classifier built with scikit-learn.
13
+
14
+ ## How to use
15
+
16
+ ```python
17
+ import joblib
18
+ from huggingface_hub import hf_hub_download
19
+
20
+ # Download model files
21
+ model_path = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="model.pkl")
22
+ vec_path = hf_hub_download(repo_id="saravananoeaxl/spam-detector", filename="vectorizer.pkl")
23
+
24
+ # Load
25
+ model = joblib.load(model_path)
26
+ vec = joblib.load(vec_path)
27
+
28
+ # Predict
29
+ text = ["Win a free iPhone now!!!"]
30
+ result = model.predict(vec.transform(text))
31
+ print(result) # ['spam']
32
+ ```
33
+
34
+ ## Model details
35
+
36
+ - Algorithm: Logistic Regression
37
+ - Features: CountVectorizer (bag of words)
38
+ - Labels: `spam`, `not spam`