TagWise β CatTagger-1
A multi-class text category tagger: given a text description it returns one of 8 categories with a confidence score, for auto-cataloguing. This repository contains two models:
cattagger1/β a fine-tuned MiniLM-L6 encoder (CatTagger-1).baseline_tfidf_logreg.joblibβ a TF-IDF + logistic-regression reference tagger.
Performance (test macro-F1)
| Model | Macro-F1 |
|---|---|
| TF-IDF baseline | 0.85 |
| CatTagger-1 (MiniLM) | 0.82 |
Honest finding: on this long, keyword-rich corpus the simple TF-IDF baseline outperforms the fine-tuned transformer on every category. Both are provided so you can pick the right trade-off.
License
Apache-2.0 β free to use, modify, and redistribute with attribution.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo = "snowfire/tagwise-cattagger1"
tok = AutoTokenizer.from_pretrained(repo, subfolder="cattagger1")
model = AutoModelForSequenceClassification.from_pretrained(repo, subfolder="cattagger1").eval()
text = "my mortgage escrow account was mishandled by the loan servicer"
enc = tok(text, truncation=True, max_length=160, return_tensors="pt")
with torch.no_grad():
probs = model(**enc).logits.softmax(-1)[0]
print(model.config.id2label[int(probs.argmax())], float(probs.max()))
Data
Developed on a public-domain text corpus (U.S. government records), organised into 8 balanced categories.
Model tree for snowfire/tagwise-cattagger1
Base model
nreimers/MiniLM-L6-H384-uncased