sentiment-analyzer-v2-final
Model Card for pauL9990/sentiment-analyzer-v2-final
Model Details
- Developer: Porjanya Paul Bordoloi (@pauL9990)
- Base Model: distilbert-base-uncased
- Architecture: Transformer (DistilBERT) + LoRA (Low-Rank Adaptation)
- Language: English
- License: Apache 2.0
- Framework: PyTorch + Hugging Face Transformers + PEFT
- Tags: sentiment-analysis, transformers, LoRA, NLP, HuggingFace, fine-tuning
Model Description
sentiment-analyzer-v2-final
is a LoRA fine-tuned version of DistilBERT for binary sentiment classification.
This model is trained on the IMDB movie review dataset and enhanced with real-world short-form and mixed sentiment examples, optimized for:
- Gen-Z and informal expressions
- Sarcasm, ambiguity, and mixed opinions
- Lightweight, deployable inference (adapter-only)
Intended Use
Direct Use
- Review analysis in apps and websites
- Customer feedback classification
- Comment moderation (social platforms)
- Short-form content sentiment detection
Out-of-Scope
- Multi-lingual sentiment analysis
- Domain-specific tone modeling (e.g., legal, medical)
How to Use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel
import torch
tokenizer = AutoTokenizer.from_pretrained("pauL9990/sentiment-analyzer-v2-final")
base_model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=2)
model = PeftModel.from_pretrained(base_model, "pauL9990/sentiment-analyzer-v2-final")
model.eval()
def analyze_sentiment(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=256)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)
label = "Positive" if torch.argmax(probs) == 1 else "Negative"
confidence = round(probs.max().item() * 100, 2)
return label, confidence
Citation
@misc{bordoloi2025sentimentanalyzer, title={Sentiment Analyzer V2 - LoRA Fine-Tuned DistilBERT}, author={Paul Bordoloi}, year={2025}, howpublished={\url{https://huggingface.co/pauL9990/sentiment-analyzer-v2-final}}, }
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for pauL9990/sentiment-analyzer-v2-final
Base model
distilbert/distilbert-base-uncased