Downloads · 30 days
1.1K
24% of all-time downloads
RyanGao/mental-roberta-depression-onnx
mental-roberta-depression-onnx is a text classification model from RyanGao. Use it when you need a label for a piece of text. It is set up for transformers.js. The card lists the license as cc-by-nc-4.0.
This is an ONNX conversion of karangupta224/mentalrobertadepression for use with Transformers.js and browser/serverless deployments.
Downloads · 30 days
1.1K
24% of all-time downloads
All-time downloads
4.6K
Public
Repo size
499 MB
Likes
0
Public
Click a slice to open those files.
.onnx1.5 GB · 100%
From the Hugging Face model README
This is an ONNX conversion of karangupta224/mental_roberta_depression for use with Transformers.js and browser/serverless deployments.
Task: Text classification for depression detection
Base Model: Based on mental/mental-roberta-base, a RoBERTa model pretrained on mental health-related Reddit posts.
Labels: depression / non-depression
This model is designed for:
⚠️ Important: This model is NOT a replacement for professional mental health diagnosis. It should be used as a screening tool only, and anyone showing signs of mental distress should be referred to qualified mental health professionals.
Original PyTorch model metrics:
import { pipeline } from '@xenova/transformers';
const classifier = await pipeline('text-classification', 'RyanGao/mental-roberta-depression-onnx');
const result = await classifier('I feel very sad and hopeless');
console.log(result);
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
model = ORTModelForSequenceClassification.from_pretrained("RyanGao/mental-roberta-depression-onnx")
tokenizer = AutoTokenizer.from_pretrained("RyanGao/mental-roberta-depression-onnx")
inputs = tokenizer("I feel very sad and hopeless", return_tensors="pt")
outputs = model(**inputs)
The original model was fine-tuned on mental health-related datasets. See the original model card for details.
If you use this model, please cite the original MentalRoBERTa paper:
@inproceedings{ji2022mentalbert,
title = {{MentalBERT: Publicly Available Pretrained Language Models for Mental Healthcare}},
author = {Shaoxiong Ji and Tianlin Zhang and Luna Ansari and Jie Fu and Prayag Tiwari and Erik Cambria},
year = {2022},
booktitle = {Proceedings of LREC}
}
This model is licensed under CC-BY-NC-4.0, same as the original model.