Loading…
Loading…
Binary classification of the spiritual wellness dimension in English social-media posts. This is the MultiWD model from the SAGEMH thesis, released as a merged model.
Qwen/Qwen2-0.5BConsider this post: "<post>" Question: Does the spiritual wellness dimension exist in the post?Yes or No, followed by a short rationaleGreedy decoding (do_sample=False), maximum 64 new tokens, Qwen2 chat template.
| Metric | Value |
|---|---|
| Weighted F1 | 80.90 |
| Macro F1 | 79.34 |
| Balanced accuracy | 79.30 |
| Accuracy | 80.91 |
| MCC | 0.5868 |
The released merged model differs from the frozen thesis predictions on 2 of 2441 rows (weighted F1 80.90 here vs 80.81 in the thesis). The difference is within float16 and batch rounding.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "g-tertho/sagemh-qwen2-0.5b-multiwd"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo, torch_dtype=torch.float16, device_map="auto")
post = "..."
question = "Does the spiritual wellness dimension exist in the post?"
prompt = tok.apply_chat_template(
[{"role": "user", "content": f'Consider this post: "{post}" Question: {question}'}],
tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs, do_sample=False, max_new_tokens=64,
eos_token_id=tok.convert_tokens_to_ids("<|im_end|>"),
pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Apache-2.0, following Qwen/Qwen2-0.5B.
@misc{ghosh2026sagemh,
title={SAGEMH: A Retrieval-Grounded, Ensembled Framework for Mental Health Classification from Social Media Text Data with Small Language Models},
author={Ghosh, Tertho and Sweety, Fahmida},
year={2026}
}
Qwen/Qwen2-0.5B