Downloads · 30 days
14
6% of all-time downloads
th-nuernberg/xlm-roberta-base-online-counseling-oncoco
xlm-roberta-base-online-counseling-oncoco is a text classification model from th-nuernberg. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
Fine-tuned XLM-RoBERTa base model for fine-grained message classification in psychosocial online counseling conversations. Trained on the OnCoCo 1.0 dataset.
Downloads · 30 days
14
6% of all-time downloads
All-time downloads
248
Public
Parameters
278M
3.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.2 GB · 66%
From the Hugging Face model README
Fine-tuned XLM-RoBERTa base model for fine-grained message classification in psychosocial online counseling conversations. Trained on the OnCoCo 1.0 dataset.
Try it out: OnCoCo Message Classifier Space
This model classifies individual messages from online counseling conversations into one of 66 fine-grained categories — 38 counselor and 28 client categories — covering communication acts such as empathic reflection, problem exploration, motivational interviewing techniques, resource activation, and emotional support.
Messages are prefixed with the speaker role (Counselor: / Client: in English, Berater: / Klient: in German) to allow the model to resolve the role context. At inference time, logits for the other speaker's categories are masked so predictions always fall within the correct role-specific category set.
The model was developed as part of the OnCoCo project at Technische Hochschule Nürnberg.
The best model we trained on this dataset is th-nuernberg/xlm-roberta-large-online-counseling-oncoco.
Evaluated on a held-out 20% test split of the OnCoCo 1.0 dataset (bilingual DE+EN):
| Metric | Score |
|---|---|
| Top-1 Accuracy | 0.76 |
| Top-1 Macro F1 | 0.68 |
| Top-2 Accuracy | 0.86 |
| Top-2 Macro F1 | 0.79 |
FacebookAI/xlm-roberta-baseCounselor: / Client: (EN) or Berater: / Klient: (DE)import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "th-nuernberg/xlm-roberta-base-online-counseling-oncoco"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
text = "Counselor: It sounds like you're feeling overwhelmed. Can you tell me more?"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
probs = F.softmax(model(**inputs).logits, dim=-1).squeeze()
top3 = probs.argsort(descending=True)[:3]
for i in top3:
print(f"{model.config.id2label[i.item()]}: {probs[i].item():.4f}")
To resolve category codes to human-readable descriptions:
import json
from huggingface_hub import hf_hub_download
path = hf_hub_download("th-nuernberg/OnCoCoV1", "code_to_category.json", repo_type="dataset")
with open(path) as f:
code2cat = json.load(f)
for i in top3:
code = model.config.id2label[i.item()]
print(f"{code} — {code2cat.get(code, '?')}: {probs[i].item():.4f}")
The 66 categories are organized hierarchically for both speaker roles:
Counselor (38 categories)
Client (28 categories)
Full label descriptions are available via the code_to_category.json file in the dataset repository.
If you use this model, please cite the OnCoCo paper:
@inproceedings{albrecht-etal-2026-oncoco,
title = "{O}n{C}o{C}o 1.0: A Public Dataset for Fine-Grained Message Classification in Online Counseling Conversations",
author = "Albrecht, Jens and Lehmann, Robert and Poltermann, Aleksandra and Rudolph, Eric and Steigerwald, Philipp and Stieler, Mara",
booktitle = "Proceedings of the Joint Workshop on Social Context (SoCon) and Integrating NLP and Psychology to Study Social Interactions (NLPSI) at LREC-COLING 2026",
month = may,
year = "2026",
address = "Palma de Mallorca, Spain",
publisher = "ELRA and ICCL",
}
ArXiv preprint: arXiv:2512.09804
CC BY-SA 4.0 — Technische Hochschule Nürnberg