File size: 5,229 Bytes
de0b645 fbd7818 de0b645 509772e de0b645 509772e de0b645 fbd7818 de0b645 fbd7818 de0b645 509772e de0b645 509772e de0b645 509772e fbd7818 509772e de0b645 509772e fbd7818 de0b645 dd3e782 de0b645 509772e de0b645 fbd7818 de0b645 509772e de0b645 509772e de0b645 fbd7818 de0b645 509772e de0b645 d3cd28b de0b645 fbd7818 de0b645 509772e de0b645 509772e de0b645 509772e de0b645 509772e de0b645 fbd7818 de0b645 fbd7818 de0b645 509772e de0b645 fbd7818 de0b645 509772e de0b645 509772e de0b645 509772e de0b645 509772e de0b645 fbd7818 de0b645 509772e de0b645 fbd7818 de0b645 fbd7818 de0b645 509772e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
---
library_name: transformers
license: apache-2.0
datasets:
- Private
language:
- en
metrics:
- accuracy
- precision
- recall
- f1
base_model: google-bert/bert-base-uncased
pipeline_tag: text-classification
---
# Model Card for Model ID
This is a fine-tuned BERT model (`bert-base-uncased`) used for classifying text into two categories: **Depression** or **Non-depression**. The model is designed for text classification and has been trained on a custom dataset of mental health-related posts from social media.
### Model Description
This model aims to identify signs of depression in written text. It was trained on social media posts labeled as either indicative of depression or not. The model uses the BERT architecture for text classification and was fine-tuned specifically for this task.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- **Developed by:** Ashish Poudel
- **Model type:** Text Classification
- **Language(s) (NLP):** English (`en`)
- **License:** `apache-2.0`
- **Finetuned from model:** `apache-2.0`
### Model Sources [optional]
- **Repository:** [Sentiment Classifier for Depression](https://huggingface.co./poudel/sentiment-classifier)
- **Demo [optional]:** [Live Gradio App](https://huggingface.co./spaces/poudel/Sentiment_classifier)
### Use
This model is designed to classify text as either depression-related or non-depression-related. It can be used in social media sentiment analysis, mental health research, and automated text analysis systems.
### Downstream Use
The model can be further fine-tuned for other types of sentiment analysis tasks related to mental health.
### Out-of-Scope Use
The model should not be used for clinical diagnosis or decision-making without the input of medical professionals. It is also unsuitable for text that is not in English or very short/ambiguous inputs.
## Bias, Risks, and Limitations
The model may suffer from biases inherent in the dataset, such as overrepresenting certain language patterns. It is trained on social media posts, which may not capture all the nuances of real-world conversations about mental health
### Recommendations
Users should use the model with caution in sensitive applications such as mental health monitoring. It is advised that the model be used alongside professional judgment.
## How to Get Started with the Model
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("poudel/sentiment-classifier")
tokenizer = AutoTokenizer.from_pretrained("poudel/sentiment-classifier")
inputs = tokenizer("I feel hopeless.", return_tensors="pt")
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits).item()
## Training Details
### Training Data
The model was trained on a custom dataset of tweets labeled as either depression-related or not. Data pre-processing included tokenization and removal of special characters.
### Training Procedure
The model was trained using Hugging Face's transformers library. The training was conducted on a T4 GPU over 3 epochs, with a batch size of 16 and a learning rate of 5e-5.
#### Preprocessing
Text was lowercased, and special characters were removed as well as Tokenization was done using the bert-base-uncased tokenizer.
#### Training Hyperparameters
- **Training regime:** fp32
- **Epochs:** 3
- **Learning rate:** 5e-5
- **Batch size:** 16
#### Speeds, Sizes, Times
Training was conducted for approximately 1 hour on a T4 GPU in Google Colab.
#### Evaluation and Testing Data
The model was evaluated on a 20% holdout set from the custom dataset.
#### Metrics
The model was evaluated using accuracy, precision, recall, and F1 score.
### Results
Accuracy: 99.87%
Precision: 99.91%
Recall: 99.81%
F1 Score: 99.86%
#### Summary
The model achieved high performance across all key metrics, indicating strong predictive capabilities for the text classification task.
## Environmental Impact
<!-- Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- **Hardware Type:** [T4 GPU]
- **Hours used:** [ 1 hour]
- **Cloud Provider:** [Google Cloud (Colab)]
- **Carbon Emitted:** [Estimated at 0.45 kg CO2eq]
## Technical Specifications
The model uses the BERT (bert-base-uncased) architecture and was fine-tuned for binary classification (depression vs non-depression).
### Model Architecture and Objective
#### Hardware
T4 GPU
#### Software
Hugging Face transformers library.
## Citation [optional]
If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section.
**BibTeX:**
[@misc{poudel2024sentimentclassifier,
author = {Poudel, Ashish},
title = {Sentiment Classifier for Depression},
year = {2024},
url = {https://huggingface.co./poudel/sentiment-classifier},
}
]
**APA:**
Poudel, A. (2024). Sentiment Classifier for Depression. Retrieved from https://huggingface.co./poudel/sentiment-classifier.
## Model Card Authors
[Ashish Poudel]
## Model Card Contact
[email protected] |