Instructions to use gozus19p/pue-score-minilm-stack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use gozus19p/pue-score-minilm-stack with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("gozus19p/pue-score-minilm-stack", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
pue-score-minilm-stack
Stack ensemble: MiniLM-L12-H384-uncased (embedding frozen, CLS+mean pooling) + SVM-RBF (balanced, x2) + TF-IDF (word 1-2 + char 3-5) LogReg -> meta LogReg. Addestrato sul confusion matrix di FRIDA. Secondo miglior modello (AUC OOF 0.66 sul training). NOTA: le etichette FRIDA sono anti-correlate col feedback umano; questo modello ha AUC 0.43 sul test. Usare il modello rule-based (pue-score-minilm-rulebased) per la produzione.
Metriche (test set, 184 righe, 37 KO)
| Metrica | Valore |
|---|---|
| Precision | 0.2035 |
| Recall | 0.9459 |
| F1 | 0.3349 |
| Accuracy | 0.2446 |
Confusion matrix: {"tn": 10, "fp": 137, "fn": 2, "tp": 35}
Uso
from huggingface_hub import hf_hub_download
from inference import RuleBasedClassifier
# per il modello rule-based:
clf = RuleBasedClassifier("config.json")
result = clf.predict("testo dell'aggiuntivo...")
print(result["esito"]) # "OK" (approva) o "KO" (vai in direzione)
Config
{
"architecture": "stack: MiniLM-L12-H384-uncased frozen emb (CLS+mean, seq128) -> SVM-RBF bal x2 + TF-IDF(word 1-2 + char 3-5) LogReg -> meta LogReg bal",
"base_model": "microsoft/MiniLM-L12-H384-uncased",
"max_seq_length": 128,
"preprocessing": "clean_v2 (strip_html + lower + no apostrofi/punteggiatura/trattini, max 60 parole)",
"label_positive": "KO (1) = mandare in direzione",
"label_negative": "OK (0) = approvazione automatica",
"threshold": 0.2970997186143757,
"threshold_rule": "F0.5-optimal su OOF 5-fold (seed 42) β FN costa meno di FP",
"seed": 42,
"oof_f05": 0.8419233865425774,
"oof_metrics": {
"threshold": 0.2970997186143757,
"precision": 0.8205913309731127,
"recall": 0.9396296702092692,
"f1": 0.8760854019818163,
"accuracy": 0.7881592734893469,
"confusion_matrix": {
"tn": 450,
"fp": 1875,
"fn": 551,
"tp": 8576
}
}
}
Nota
Le etichette di training (TP/FN/FP/TN) sono il confusion matrix del modello FRIDA e sono anti-correlate col feedback umano (FB_ESITO). Il modello rule-based implementa il criterio umano direttamente dalle linee guida di business (testo non standard β KO).
- Downloads last month
- -