Views
No views yet
legalbert-seeks_guidance and only trust the topic label when stage 1 predicts legal guidance.User: content lines (assistant turns are dropped). Legal-BERT uses 512-token truncation.(non-guidance) as modernbert-primary_topic.| Split | N | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|
| Validation (best checkpoint) | 106 | 79.25% | 78.88% | 79.25% | 78.42% |
| Test (held-out) | 107 | 78.50% | 81.45% | 78.50% | 78.65% |
legalbert-seeks_guidance): legal 84.1%, topic 72.0%, joint 72.0%.1from transformers import AutoModelForSequenceClassification, AutoTokenizer
2
3model_id = "AmirMohseni/legalbert-primary_topic"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForSequenceClassification.from_pretrained(model_id)
6input_mode = getattr(model.config, "legal_cls_input_mode", "user")
7max_length = getattr(model.config, "legal_cls_max_length", 512)legalbert-seeks_guidance for a full two-stage example.primary_topic (empty for non-guidance rows)legalbert_classifier_sweep_colab.ipynb.| Setting | Value |
|---|---|
| Base model | nlpaueb/legal-bert-base-uncased |
| Input mode | User turns only |
| Max length | 512 |
| Learning rate | 1e-4 |
| Epochs | 8 |
| Effective batch size | 128 (32 × 4 grad accum) |
| Best checkpoint | Highest validation accuracy (79.25%) |