|
--- |
|
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 Details |
|
|
|
### 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] |
|
|
|
<!-- Provide the basic links for the model. --> |
|
|
|
- **Repository:** [Sentiment Classifier for Depression](https://huggingface.co./poudel/sentiment-classifier) |
|
- **Demo [optional]:** [Live Gradio App](https://huggingface.co./spaces/poudel/Sentiment_classifier) |
|
|
|
## Uses |
|
|
|
<!-- --> |
|
|
|
### Direct 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 [optional] |
|
|
|
<!-- 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 |
|
|
|
### Testing Data, Factors & Metrics |
|
|
|
#### 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]] |