Commit ·
c8d901b
0
Parent(s):
Initial upload (model + data)
Browse files- .gitattributes +2 -0
- README.md +33 -0
- classifier.pkl +3 -0
- requirements.txt +3 -0
- train.csv +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.csv filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Autopilot Email Classifier
|
| 2 |
+
|
| 3 |
+
A scikit-learn TF-IDF + Logistic Regression model that predicts
|
| 4 |
+
whether an e-mail is **purchase-related**.
|
| 5 |
+
|
| 6 |
+
## Quick Usage
|
| 7 |
+
|
| 8 |
+
```bash
|
| 9 |
+
pip install -r requirements.txt # step 1 – install deps
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
```python
|
| 13 |
+
from huggingface_hub import hf_hub_download
|
| 14 |
+
import joblib
|
| 15 |
+
|
| 16 |
+
# step 2 – download & load
|
| 17 |
+
path = hf_hub_download(
|
| 18 |
+
repo_id = "Settlemate/autopilot-email-classifier",
|
| 19 |
+
filename = "classifier.pkl",
|
| 20 |
+
local_dir = "."
|
| 21 |
+
)
|
| 22 |
+
bundle = joblib.load(path)
|
| 23 |
+
pipe, thresh = bundle["pipeline"], bundle["threshold"]
|
| 24 |
+
|
| 25 |
+
def classify_email(subject, body):
|
| 26 |
+
proba = pipe.predict_proba([f"{subject} {body}"])[0, 1]
|
| 27 |
+
return "purchase" if proba >= thresh else "non-purchase"
|
| 28 |
+
|
| 29 |
+
subj = "Solo founder, $80M exit – Base44 story"
|
| 30 |
+
body = ("Base44’s founder on bootstrapping to profitability, using AI "
|
| 31 |
+
"to write 90 % of his code, and turning down VC money…")
|
| 32 |
+
print(classify_email(subj, body))
|
| 33 |
+
```
|
classifier.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2150241a614e7937cd36d8de50de125e396fb494b1feaa8c9de219641f26c69
|
| 3 |
+
size 79271
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
scikit-learn>=1.4
|
| 2 |
+
joblib>=1.4
|
| 3 |
+
huggingface_hub>=0.23
|
train.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ba38e1956b75db018bca8d0a2158abf8ca07ea7285d00d1b8dd8d42e6e1ea5b9
|
| 3 |
+
size 355855
|