Downloads · 30 days
0
YatishW79/classical-ml-goemotions
classical-ml-goemotions is a text classification model from YatishW79. Use it when you need a label for a piece of text. It is set up for sklearn. The card lists the license as mit.
TF-IDF + OneVsRest classifiers for multi-label emotion classification on GoEmotions (28 labels).
Downloads · 30 days
0
Access
Public
Updated Apr 23, 2026
Repo size
23.4 MB
Likes
0
Public
Click a slice to open those files.
.pkl23.4 MB · 100%
From the Hugging Face model README
TF-IDF + OneVsRest classifiers for multi-label emotion classification on GoEmotions (28 labels).
CS6120 NLP Project — Northeastern University
| Model | Micro-F1 | Macro-F1 | Subset Acc | Hamming Acc |
|---|---|---|---|---|
| Logistic Regression | 0.4448 | 0.2388 | 0.3156 | 0.9658 |
| LinearSVC (calibrated) | 0.5233 | 0.4266 | 0.3097 | 0.9542 |
| XGBoost | 0.5485 | 0.4044 | 0.4133 | 0.9622 |
tfidf_vectorizer.pkl — TF-IDF vectorizer (15k features, bigrams, sublinear TF)mlb.pkl — MultiLabelBinarizer (28 GoEmotions labels)logistic_regression.pkl — OneVsRest Logistic Regressionlinearsvc.pkl — OneVsRest LinearSVC (Platt-calibrated)xgboost.pkl — OneVsRest XGBoostthresholds_lr.pkl — per-class optimal thresholds for LR (numpy array, shape 28)thresholds_linearsvc.pkl — per-class optimal thresholds for LinearSVC (numpy array, shape 28)import joblib, numpy as np
tfidf = joblib.load("tfidf_vectorizer.pkl")
mlb = joblib.load("mlb.pkl")
model = joblib.load("xgboost.pkl") # or logistic_regression / linearsvc
thresholds = joblib.load("thresholds_lr.pkl") # for LR; skip for XGBoost (use 0.30)
X = tfidf.transform(["I am so happy and grateful today!"])
proba = model.predict_proba(X)
preds = (proba >= thresholds).astype(int) # shape (1, 28)
labels = mlb.classes_[preds[0].astype(bool)]
print(labels)