AventIQ-AI / distilBERT_Sentiment_Analysis

huggingface.co
Total runs: 13
24-hour runs: -1
7-day runs: 2
30-day runs: 6
Model's Last Updated: May 09 2025

Introduction of distilBERT_Sentiment_Analysis

Model Details of distilBERT_Sentiment_Analysis

DistilBERT Quantized Model for IMDB Sentiment Analysis

This repository contains a quantized DistilBERT model fine-tuned for binary sentiment classification on IMDB movie reviews. Optimized for production deployment, the model achieves high accuracy while maintaining efficiency.

Model Details
  • Model Architecture: DistilBERT Base Uncased
  • Task: Binary Sentiment Analysis (Positive/Negative)
  • Dataset: IMDB Movie Reviews (50K samples)
  • Quantization: Dynamic Quantization (INT8)
  • Framework: Hugging Face Transformers + PyTorch
Usage
Installation
pip install transformers torch scikit-learn pandas
Loading the Model
from transformers import DistilBertForSequenceClassification, DistilBertTokenizer
import torch

# Load quantized model
model_path = "./quantized_sentiment_model.pth"
model = DistilBertForSequenceClassification.from_pretrained("./sentiment_model")
model.load_state_dict(torch.load(model_path))
model.eval()

# Load tokenizer
tokenizer = DistilBertTokenizer.from_pretrained("./sentiment_model")

def predict_sentiment(text):
    inputs = tokenizer(text, return_tensors="pt", 
                      padding=True, truncation=True, 
                      max_length=128)
    
    with torch.no_grad():
        outputs = model(**inputs)
    
    prediction = torch.argmax(outputs.logits).item()
    return "Positive" if prediction == 1 else "Negative"

# Example usage
review = "This movie blew me away with its stunning visuals and gripping storyline."
print(predict_sentiment(review))  # Output: Positive
📊 Performance Metrics
Metric Value
Accuracy 89.1%
F1 Score 89.0%
Inference Latency (CPU) 12ms
Model Size 67MB
🏋️ Training Details
Dataset
  • 50,000 IMDB movie reviews
  • Balanced binary classes (50% positive, 50% negative)
Hyperparameters
  • Epochs: 5
  • Batch Size: 24 (Effective 48 with accumulation)
  • Learning Rate: 8e-6
  • Warmup Ratio: 10%
  • Weight Decay: 0.005
  • Optimizer: AdamW with Cosine LR Schedule
Quantization

Applied dynamic post-training quantization:

quantized_model = torch.quantization.quantize_dynamic(
    model, {torch.nn.Linear}, dtype=torch.qint8
)
📁 Repository Structure
.
├── sentiment_model/                # Full-precision model files
│   ├── config.json
│   ├── pytorch_model.bin
│   └── tokenizer files...
├── quantized_sentiment_model.pth  # Quantized weights
├── imdb_train.csv                 # Sample training data
├── train.py                       # Training script
└── inference.py                   # Usage examples
⚠️ Limitations
  • Accuracy may drop on reviews with:
    • Sarcasm or nuanced language
    • Domain-specific terminology (non-movie content)
  • Maximum sequence length: 128 tokens
  • English language only

Runs of AventIQ-AI distilBERT_Sentiment_Analysis on huggingface.co

13
Total runs
-1
24-hour runs
3
3-day runs
2
7-day runs
6
30-day runs

More Information About distilBERT_Sentiment_Analysis huggingface.co Model

distilBERT_Sentiment_Analysis huggingface.co

distilBERT_Sentiment_Analysis huggingface.co is an AI model on huggingface.co that provides distilBERT_Sentiment_Analysis's model effect (), which can be used instantly with this AventIQ-AI distilBERT_Sentiment_Analysis model. huggingface.co supports a free trial of the distilBERT_Sentiment_Analysis model, and also provides paid use of the distilBERT_Sentiment_Analysis. Support call distilBERT_Sentiment_Analysis model through api, including Node.js, Python, http.

distilBERT_Sentiment_Analysis huggingface.co Url

https://huggingface.co/AventIQ-AI/distilBERT_Sentiment_Analysis

AventIQ-AI distilBERT_Sentiment_Analysis online free

distilBERT_Sentiment_Analysis huggingface.co is an online trial and call api platform, which integrates distilBERT_Sentiment_Analysis's modeling effects, including api services, and provides a free online trial of distilBERT_Sentiment_Analysis, you can try distilBERT_Sentiment_Analysis online for free by clicking the link below.

AventIQ-AI distilBERT_Sentiment_Analysis online free url in huggingface.co:

https://huggingface.co/AventIQ-AI/distilBERT_Sentiment_Analysis

distilBERT_Sentiment_Analysis install

distilBERT_Sentiment_Analysis is an open source model from GitHub that offers a free installation service, and any user can find distilBERT_Sentiment_Analysis on GitHub to install. At the same time, huggingface.co provides the effect of distilBERT_Sentiment_Analysis install, users can directly use distilBERT_Sentiment_Analysis installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

distilBERT_Sentiment_Analysis install url in huggingface.co:

https://huggingface.co/AventIQ-AI/distilBERT_Sentiment_Analysis

Url of distilBERT_Sentiment_Analysis

distilBERT_Sentiment_Analysis huggingface.co Url

Provider of distilBERT_Sentiment_Analysis huggingface.co

AventIQ-AI
ORGANIZATIONS

Other API from AventIQ-AI