Views
No views yet
roberta-base
on a combined corpus of 200 000+ samples spanning movie reviews, short sentences,
tweets, and restaurant reviews.| ID | Label | Description |
|---|---|---|
| 0 | Negative | Negative sentiment / opinion |
| 1 | Neutral | Neutral / mixed sentiment |
| 2 | Positive | Positive sentiment / opinion |
| Metric | Value |
|---|---|
| Val Accuracy | 0.8239 |
| Val F1 (macro) | 0.7827 |
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="airzipm/sentiment-analysis-roberta",
6)
7
8# Single prediction
9print(classifier("This movie was absolutely amazing!"))
10# [{'label': 'Positive', 'score': 0.97}]
11
12# Batch prediction
13texts = [
14 "Great product, highly recommend!",
15 "It was okay, nothing special.",
16 "Terrible experience, waste of money.",
17]
18for t, r in zip(texts, classifier(texts)):
19 print(f"{t[:45]:50s} → {r['label']} ({r['score']:.1%})")| 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 |
| 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.png and confusion_matrix.png in this repository.