Text Classification
Transformers
Safetensors
PyTorch
English
roberta
sentiment-analysis
text-embeddings-inference
Instructions to use airzipm/sentiment-analysis-roberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use airzipm/sentiment-analysis-roberta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="airzipm/sentiment-analysis-roberta")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("airzipm/sentiment-analysis-roberta") model = AutoModelForSequenceClassification.from_pretrained("airzipm/sentiment-analysis-roberta", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 2,404 Bytes
77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 77a4317 6eec569 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ---
language: en
license: apache-2.0
tags:
- text-classification
- sentiment-analysis
- roberta
- pytorch
- transformers
datasets:
- imdb
- glue
- tweet_eval
- yelp_review_full
pipeline_tag: text-classification
---
# π Sentiment Analysis β airzipm
A powerful **3-class sentiment analysis** model fine-tuned from `roberta-base`
on a combined corpus of 200 000+ samples spanning movie reviews, short sentences,
tweets, and restaurant reviews.
## π·οΈ Labels
| ID | Label | Description |
|----|----------|-------------------------------|
| 0 | Negative | Negative sentiment / opinion |
| 1 | Neutral | Neutral / mixed sentiment |
| 2 | Positive | Positive sentiment / opinion |
## π Performance
| Metric | Value |
|-----------------|------------------------|
| Val Accuracy | 0.8239 |
| Val F1 (macro) | 0.7827 |
## π Quick Usage
```python
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="airzipm/sentiment-analysis-roberta",
)
# Single prediction
print(classifier("This movie was absolutely amazing!"))
# [{'label': 'Positive', 'score': 0.97}]
# Batch prediction
texts = [
"Great product, highly recommend!",
"It was okay, nothing special.",
"Terrible experience, waste of money.",
]
for t, r in zip(texts, classifier(texts)):
print(f"{t[:45]:50s} β {r['label']} ({r['score']:.1%})")
```
## π οΈ Training Details
| Setting | Value |
|------------------|-------------------|
| Base model | `roberta-base` |
| Max token length | 128 |
| Batch size | 32 |
| Learning rate | 2e-5 |
| Optimizer | AdamW + warmup |
| Mixed precision | FP16 |
| Label smoothing | 0.1 |
| Class weights | Balanced |
## π¦ Training Data
| Dataset | Domain | Samples |
|-------------|-----------------|---------|
| IMDB | Movie reviews | 50 000 |
| SST-2 | Short sentences | 50 000 |
| Tweet Eval | Twitter posts | 50 000 |
| Yelp Review | Business review | 50 000 |
## πΌοΈ Training Curves & Confusion Matrix
See `training_curves.png` and `confusion_matrix.png` in this repository.
## π€ Author
Created by **airzipm** β [Hugging Face Profile](https://huggingface.co/airzipm)
|