Downloads · 30 days
0
Settlemate/autopilot-email-classifier
autopilot-email-classifier is a machine learning model from Settlemate. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A scikit-learn TF-IDF + Logistic Regression model that predicts whether an email is purchase-related (purchase) or not (non-purchase).
Downloads · 30 days
0
Access
Public
Updated Jul 7, 2025
Repo size
435 KB
Likes
0
Public
Click a slice to open those files.
.csv356 KB · 82%
From the Hugging Face model README
A scikit-learn TF-IDF + Logistic Regression model that predicts whether an email is purchase-related (purchase) or not (non-purchase).
# 1️⃣ Clone this repository
git clone https://huggingface.co/Settlemate/autopilot-email-classifier
cd autopilot-email-classifier
# 2️⃣ Install dependencies
pip install -r requirements.txt
# 3️⃣ Load the model and classify
import joblib
# Load Model
bundle = joblib.load("classifier.pkl")
pipeline = bundle["pipeline"]
threshold = bundle["threshold"]
# Function to classify email
def classify_email(subject: str, body: str) -> str:
text = f"{subject} {body}"
proba = pipeline.predict_proba([text])[0, 1]
return "purchase" if proba >= threshold else "non-purchase"
# Example usage
if __name__ == "__main__":
subj = "Solo founder, $80M exit, 6 months: The Base44 bootstrapped startup success story | Maor Shlomo"
body = """Base44's founder on bootstrapping to profitability, using AI to write 90% of his code, why he turned down VC money, and signing an acquisition deal as missiles were flying"""
print(classify_email(subj, body))