--- 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