Downloads · 30 days
23
16% of all-time downloads
Vivek-Sham/deberta-multitask-sentiment-analysis
deberta-multitask-sentiment-analysis is a text classification model from Vivek-Sham. Use it when you need a label for a piece of text. It is set up for transformers.
This model is a multitask text classification model based on DeBERTa V3 Base, designed to handle emotion detection, polarity classification, and hate speech detection simultaneously. It leverages a shared DeBERTa back…
Downloads · 30 days
23
16% of all-time downloads
All-time downloads
148
Public
Repo size
3.8 GB
Likes
0
Public
Click a slice to open those files.
.h5751 MB · 50%
From the Hugging Face model README
This model is a multitask text classification model based on DeBERTa V3 Base, designed to handle emotion detection, polarity classification, and hate speech detection simultaneously. It leverages a shared DeBERTa backbone with task-specific LSTMs, attention, and dense layers for each task. The model is fine-tuned on custom datasets for these tasks.
This multitask DeBERTa model performs three text classification tasks:
This model can be used directly for text and Social Media Comments:
This model may exhibit biases based on the nature of the dataset it was fine-tuned on. These biases could include cultural, demographic, or contextual factors. Users should consider that the model may not generalize well across different datasets, and it might show inaccuracies when applied to texts with sarcasm, slang, or specific cultural references.
from transformers import DebertaV2Tokenizer, DebertaV2Model
import torch
# Load the tokenizer and model
tokenizer = DebertaV2Tokenizer.from_pretrained('path_to_model')
model = torch.load('path_to_model/pytorch_model.bin')
# Tokenize input text
inputs = tokenizer(["I love this!", "I hate this!"], return_tensors='pt', max_length=256, truncation=True, padding=True)
# Predict
with torch.no_grad():
outputs = model(**inputs)
# Get logits for each task
emotion_logits = outputs['emotion']
polarity_logits = outputs['polarity']
hate_speech_logits = outputs['hate_speech']
The model was fine-tuned on custom datasets for emotion detection, polarity classification, and hate speech detection. The data includes text samples from social media, reviews, and other platforms relevant to these tasks.
Data preprocessing involved tokenization using DeBERTa's tokenizer, padding to a maximum length of 256 tokens, and truncating where necessary.
Training Hyperparameters
The model achieved the following accuracy scores: