加载中…
加载中…
Qwen/Qwen2-0.5BBinary classification of thwarted belongingness risk in English social-media posts. This is the IRF model from the SAGEMH thesis, released as a merged model.
Qwen/Qwen2-0.5BConsider this post: "<post>" Question: Does the post show risk of thwarted belongingness?Yes or No, followed by a short rationaleGreedy decoding (do_sample=False), maximum 64 new tokens, Qwen2 chat template.
| Metric | Value |
|---|---|
| Weighted F1 | 78.33 |
| Macro F1 | 76.41 |
| Balanced accuracy | 76.67 |
| Accuracy | 78.23 |
| MCC | 0.5286 |
The released merged model differs from the frozen thesis predictions on 5 of 2113 rows (weighted F1 78.33 here vs 78.18 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-irf"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo, torch_dtype=torch.float16, device_map="auto")
post = "..."
question = "Does the post show risk of thwarted belongingness?"
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}
}