Model Card for Sentiment Analysis Model
Model Details
Model Description
This model is a fine-tuned BERT-based sentiment analysis model trained to classify tweets based on their sentiment towards an entity. The model outputs three sentiment classes: Positive, Negative, and Neutral. The model was fine-tuned using a dataset containing tweets along with their sentiment labels.
- Developed by: Praveen R
- Model type: Transformer-based model (BERT)
- Language(s) (NLP): English
- Fine-tuned from model: BERT (https://huggingface.co/bert-base-uncased)
Model Sources
- Repository: Hugging Face - Sentiment Analysis BERT Model
- Demo: Hugging Face Space - Sentiment Analysis
- Paper: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Uses
Direct Use
This model can be used to classify the sentiment of individual tweets or other text-based content into Positive, Negative, or Neutral categories. Users can directly input a tweet, and the model will return the predicted sentiment.
Downstream Use
The model can be integrated into larger systems, such as sentiment analysis platforms, social media monitoring tools, and brand reputation analysis systems, to monitor public sentiment toward different topics or entities.
Out-of-Scope Use
This model is not recommended for:
- Non-English language content (as it is specifically trained on English data).
- Analyzing extremely short text (e.g., less than 5 words) where context might be lost.
Bias, Risks, and Limitations
Risks and Biases
- The model might exhibit biases based on the training data, which may reflect common biases present in social media discourse.
- The model's performance might degrade when analyzing very specific or rare topics not seen during training.
Limitations
- The model may struggle with sarcasm or complex sentiment expressed indirectly.
- The performance of the model could vary depending on the nature and diversity of the input data.
Recommendations
- Users should exercise caution when relying on the model for sensitive or critical applications.
- It is advised to fine-tune the model with more specific data or domains if greater accuracy is required.
How to Get Started with the Model
To use this model, you can easily load it using the Hugging Face transformers library. Below is an example of how to get started:
from transformers import pipeline
# Load the sentiment analysis pipeline
model = pipeline("sentiment-analysis", model="Praveen-R/Tweet_sentiment_analysis_with_BERT")
# Example input
tweet = "I love the new Microsoft update, it's fantastic!"
result = model(tweet)
print(result)
Alternatively, you can try out the model interactively on the Hugging Face Space:
Training Details
Training Data
The model was trained on a custom dataset containing tweets with sentiment labels. The dataset consists of three classes:
- Positive
- Negative
- Neutral
The dataset can be found here.
Training Procedure
- Preprocessing: The text data was tokenized using the Hugging Face BertTokenizer before being fed into the model.
- Training Hyperparameters:
- Learning rate: 2e-5
- Batch size: 16
- Epochs: 3
Evaluation
Testing Data, Factors & Metrics
Testing Data
The model was evaluated on the same dataset, using standard performance metrics such as accuracy, precision, recall, F1-Score, and ROC-AUC.
Metrics
- Accuracy: Measures the percentage of correct predictions.
- Precision: Measures the proportion of positive predictions that are actually correct.
- Recall: Measures the proportion of actual positives that are correctly identified.
- F1-Score: The harmonic mean of precision and recall.
- ROC-AUC: Measures the model's ability to distinguish between classes.
Model Examination
The model has been evaluated for interpretability using basic tools, such as LIME (Local Interpretable Model-agnostic Explanations), to explain individual predictions.
Technical Specifications
Model Architecture and Objective
The model is based on the BERT (Bidirectional Encoder Representations from Transformers) architecture, which excels in understanding the context of a word based on the words around it. The objective of the model is to classify the sentiment of a given text.
Compute Infrastructure
Software
- Python 3.8
- Libraries: Transformers, PyTorch, TensorFlow, Hugging Face
Citation
If you are using this model in your work, please cite the original BERT paper:
BibTeX:
@article{devlin2018bert,
title={BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding},
author={Jacob Devlin and Ming-Wei Chang and Kenton Lee and Kristina Toutanova},
journal={arXiv preprint arXiv:1810.04805},
year={2018}
}
APA:
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv preprint arXiv:1810.04805.
Glossary
- BERT: A transformer-based model used for NLP tasks like sentiment analysis, text classification, etc.
- ROC-AUC: A performance metric that evaluates the ability of a model to distinguish between classes.
More Information
For further details, refer to the Hugging Face model repository (https://huggingface.co/Praveen-R/Tweet_sentiment_analysis_with_BERT).
Model Card Authors
- Praveen R (Developer and Contributor)
Model Card Contact
For any inquiries, please reach out to praveensarvesh22@gmail.com.
- Downloads last month
- 74
Model tree for Praveen-R/Tweet_sentiment_analysis_with_BERT
Base model
google-bert/bert-base-uncased