Text Classification
Transformers
Safetensors
PyTorch
bert
sentiment-analysis
Eval Results (legacy)
text-embeddings-inference
Instructions to use ashwini10521/finetuned_bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ashwini10521/finetuned_bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ashwini10521/finetuned_bert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ashwini10521/finetuned_bert") model = AutoModelForSequenceClassification.from_pretrained("ashwini10521/finetuned_bert") - Notebooks
- Google Colab
- Kaggle
π¬ Finetuned BERT for Sentiment Analysis
This model is a fine-tuned version of BERT (bert-base-uncased) for binary sentiment classification (positive vs negative).
It is trained on the IMDb movie reviews dataset, a widely used benchmark for sentiment analysis tasks.
π Model Performance
| Metric | Score |
|---|---|
| Accuracy | 92.25% |
| F1 Score | 92.38% |
| Precision | 90.86% |
| Recall | 93.95% |
Confusion Matrix Insights
- Strong balance between positive and negative predictions
- Slight tendency toward higher recall (fewer false negatives)
- Overall robust generalization on full test dataset (25,000 samples)
π Model Description
This project demonstrates fine-tuning of a pre-trained Transformer model for NLP classification tasks using the Hugging Face ecosystem.
Key features:
- Pretrained BERT encoder
- Fine-tuned for binary sentiment classification
- Implemented using Hugging Face Transformers Trainer API
- Evaluated using standard classification metrics
π Dataset
- Name: IMDb Movie Reviews Dataset
- Size:
- Train: 25,000 samples
- Test: 25,000 samples
- Classes:
0β Negative1β Positive
The dataset is balanced across both classes.
ποΈ Training Procedure
Hyperparameters
- Learning rate:
2e-5 - Batch size:
8 - Epochs:
2 - Optimizer: AdamW
- Scheduler: Linear decay
- Mixed precision: Enabled (FP16)
Training Details
- Framework: Hugging Face
Trainer - Hardware: Google Colab GPU
- Loss function: Cross-entropy
π§ Intended Use
This model can be used for:
- Sentiment analysis on movie reviews
- Product review classification
- Social media sentiment detection
- NLP learning and experimentation
β οΈ Limitations
- Trained only on English text
- Domain-specific (movie reviews) β may not generalize perfectly to other domains
- Binary classification only (no neutral sentiment)
- May inherit biases present in training data
π οΈ How to Use
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="ashwini10521/finetuned_bert")
result = classifier("This movie was absolutely amazing!")
print(result)
- Downloads last month
- 3
Model tree for ashwini10521/finetuned_bert
Base model
google-bert/bert-base-uncasedEvaluation results
- accuracy on IMDb Movie Reviewsself-reported0.922
- f1 on IMDb Movie Reviewsself-reported0.924
- precision on IMDb Movie Reviewsself-reported0.909
- recall on IMDb Movie Reviewsself-reported0.940