Views
No views yet
1LoRA Configuration:
2 r: 8
3 lora_alpha: 16
4 lora_dropout: 0.1
5 target_modules: ["query", "value"]
6 task_type: FEATURE_EXTRACTION
7
8Training:
9 epochs: 3
10 batch_size: 16
11 learning_rate: 3e-4
12 optimizer: AdamW
13 scheduler: Linear warmup + decay
14 max_sequence_length: 128
15 loss_function: CrossEntropyLoss (category + severity summed)| Metric | Score |
|---|---|
| Category Accuracy | 76.29% |
| Severity Accuracy | 78.29% |
| Test Loss | 1.1840 |
1import torch
2from services.model_factory import load_production_model
3
4# Inference
5device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
6
7# This will:
8
9# 1. Initialise DualHeadBERTClassifier
10# 2. Apply LoRA adapters
11# 3. Check for 'dual_head_classifier.pt' locally
12# 4. If missing, download latest from OguzhanKOG/sentinelai-bert-filter
13# 5. Load trained weights and return model in eval mode
14
15model = load_production_model(device=device)
16
17# Model is ready for inference
18message = "I'm completely overwhelmed with work and can't sleep anymore"
19# ... standard tokenization using config.MODEL_NAME ...filter/config.py. To change the backbone or parameters across the entire service, update this file only.Slack Message → BERT Filter (this model) → [if risk] → LLM Agent Analysis → HR Alerttraining_log.json:feature/filter