Downloads · 30 days
12
5% of all-time downloads
Sharath45/MENTALBERT_MULTILABEL_CLASSIFICATION
MENTALBERT_MULTILABEL_CLASSIFICATION is a text classification model from Sharath45. Use it when you need a label for a piece of text. It is set up for transformers.
MentalBERT is a transformer-based model tailored for mental health text analysis. Built upon the BERT architecture, it has been fine-tuned on specialized mental health datasets to capture nuanced linguistic patterns t…
Downloads · 30 days
12
5% of all-time downloads
All-time downloads
261
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
MentalBERT is a transformer-based model tailored for mental health text analysis. Built upon the BERT architecture, it has been fine-tuned on specialized mental health datasets to capture nuanced linguistic patterns that indicate various mental health states. The model aims to support research and applications in mental health assessment by offering insights into sentiment, stress, and risk factors evident in textual data.
Performance Metrics:
Benchmarking:
MentalBERT has been compared with baseline models on mental health text classification tasks, showing improved sensitivity in detecting subtle cues indicative of mental distress.
Data Bias:
The model’s predictions are influenced by the representativeness of the training data. It may exhibit bias if the training data is not diverse.
Generalization:
While effective on data similar to its training distribution, the model might underperform on texts that differ significantly in style or context.
Usage Caution:
It should be used as an assistive tool and not as a sole basis for clinical decisions.
Below is an example code snippet to get started with MentalBERT using the Hugging Face Transformers library:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Replace 'username/mentalbert' with the actual model repository path
model_name = "username/mentalbert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example: Analyzing mental health related text
text = "I have been feeling very low and anxious recently."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
# Convert logits to probabilities
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
print(probabilities)