Views
No views yet
| Subfolder | Condition (Korean) |
|---|---|
addiction/ | 중독 (addiction) |
anxiety/ | 불안 (anxiety) |
depression/ | 우울 (depression) |
[CLS] token's hidden state and outputs a single scalar, trained (via MSE loss) against a 0-3 integer severity label. Round and clip the raw output to [0, 3] to recover the discrete label used at training time.BertForSequenceClassification. The regression head reads the raw [CLS] hidden state directly (no BertPooler), so it needs the custom CustomBertForSequenceRegression class shipped in each subfolder (modeling_kluebert_regression.py). Load with trust_remote_code=True.1import torch
2from transformers import AutoModel, AutoTokenizer
3
4repo_id = "sso5803/kluebert-mental-health-severity"
5condition = "depression" # or "addiction" / "anxiety"
6
7model = AutoModel.from_pretrained(repo_id, subfolder=condition, trust_remote_code=True)
8tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder=condition)
9model.eval()
10
11text = "요즘 계속 잠도 안 오고 기운이 없어."
12inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
13with torch.no_grad():
14 score = model(**inputs).item()
15
16severity = min(max(round(score), 0), 3)
17print(f"raw score: {score:.3f}, severity (0-3): {severity}")klue/bert-baseaddiction, anxiety, depression) on transcripts labeled for that condition plus normal (non-condition) examples2e-5, batch size 16, weight decay 0.01kluebert_train.py, kluebert_run.py) are not included in this repo.addiction/anxiety/depression are not necessarily on a comparable scale.