Downloads · 30 days
9
1% of all-time downloads
bharatiyabytes/flan-t5-sarcasm
flan-t5-sarcasm is a text classification model from bharatiyabytes. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model performs sentiment analysis with a specific focus on detecting sarcasm in textual content. It is fine-tuned on a combination of standard sentiment datasets and specialized sarcastic data, allowing for more…
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
610
Public
Parameters
77M
309 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors308 MB · 100%
From the Hugging Face model README
This model performs sentiment analysis with a specific focus on detecting sarcasm in textual content. It is fine-tuned on a combination of standard sentiment datasets and specialized sarcastic data, allowing for more nuanced sentiment classification that accounts for sarcastic language.
This model leverages the Flan-T5-small transformer architecture, fine-tuned on datasets including IMDB for sentiment analysis and bharatiyabytes/sentimentWithSarcasm for sarcasm detection. By combining these datasets, the model is better equipped to differentiate between sarcastic and genuine sentiment expressions, improving sentiment analysis accuracy in contexts where sarcasm is prevalent.
This model can be used directly for sentiment classification on texts where sarcasm may obscure intended sentiment. It provides accurate classifications by considering nuanced expressions, making it ideal for social media analysis, customer feedback processing, and sarcasm-rich content sources.
This model can serve as a base for further fine-tuning for domains that require sarcasm-aware sentiment analysis, such as customer service, public relations, and social media monitoring applications.
The model may not perform well on texts with heavy dialects or informal language that goes beyond the sarcasm in the fine-tuning data. It is not intended for multi-lingual sarcasm detection.
As with many sentiment analysis models, there may be inherent biases in the sarcasm and sentiment labels in the training datasets, potentially affecting model performance across different demographic or cultural groups. Users should be cautious when using this model in critical decision-making contexts.
Users should perform additional validation on specific datasets to ensure that model predictions align with intended use cases, especially in high-stakes applications.
Use the code below to get started with the model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("your-username/sarcasm-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained("your-username/sarcasm-sentiment-analysis")
inputs = tokenizer("Your input text here", return_tensors="pt")
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)
The model was fine-tuned on a combination of IMDB (a general sentiment analysis dataset) and bharatiyabytes/sentimentWithSarcasm (designed to capture sarcastic sentiment). This blend improves the model’s ability to identify nuanced sentiment.
Standard text preprocessing methods were applied, such as tokenization and lowercase transformation.
Training regime: FP32 Epochs: 3 Batch Size: 16 Learning Rate: 3e-5
Training took approximately 4 hours on an NVIDIA V100 GPU with a model size of 60M parameters.
he model was evaluated on the IMDB and bharatiyabytes/sentimentWithSarcasm test splits.
Evaluation considers sentiment disaggregation by sarcastic vs. non-sarcastic samples.
-Accuracy: Measures overall sentiment classification accuracy. -F1 Score (Sarcasm): Evaluates the model’s sarcasm detection capability, which is key for accurate sarcastic sentiment handling.
The model achieved an accuracy of 88% on the sentiment classification task and an F1 score of 0.83 on sarcasm detection.
The model shows strong performance in sarcasm-sensitive sentiment analysis, making it suitable for applications where nuanced sentiment interpretation is crucial.
The model’s predictions have been examined to ensure that sarcastic content is accurately labeled, using interpretability tools such as SHAP to visualize model attention on sarcastic phrases.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
The model uses the Flan-T5-small architecture fine-tuned for binary sentiment classification with sarcasm detection as an enhancement.
[More Information Needed]
NVIDIA V100 GPU
Hugging Face Transformers Library, PyTorch
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]