Downloads · 30 days
10
12% of all-time downloads
ImaneAz/youtube-roberta-sentiment
youtube-roberta-sentiment is a machine learning model from ImaneAz. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model performs sentiment analysis on YouTube comments, classifying each comment into one of the following categories:
Downloads · 30 days
10
12% of all-time downloads
All-time downloads
84
Public
Parameters
125M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
This model performs sentiment analysis on YouTube comments, classifying each comment into one of the following categories:
-Negative → 0 -Neutral → 1 -Positive → 2
It is built on RoBERTa-base, a transformer model pretrained on large-scale web text, and fine-tuned on labeled YouTube comments to better capture social-media-style language, including informal expressions and emojis.
The model can be used directly to analyze sentiment in YouTube comments or similar short social media texts. Example usage: [from transformers import pipeline
classifier = pipeline( "sentiment-analysis", model="ImaneAz/youtube-roberta-sentiment" )
classifier("This video was amazing, I learned a lot!") ]
- Primary dataset: Kaggle – YouTube Comments Sentiment Dataset (English, labeled)
- Deployment alignment: Designed to be applied to YouTube comments collected via the YouTube API and stored in MongoDB
| Parameter | Value |
|---|---|
| Base model | RoBERTa-base |
| Epochs | 2 |
| Learning rate | 2e-5 |
| Batch size | 32 |
| Optimizer | AdamW |
| Precision | fp32 |
Metrics The model was evaluated on a held-out test set of 10,000 YouTube comments using standard classification metrics.
| Metric / Class | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| Negative | 0.75 | 0.80 | 0.77 | 3,332 |
| Neutral | 0.72 | 0.69 | 0.70 | 3,318 |
| Positive | 0.81 | 0.79 | 0.80 | 3,350 |
| Accuracy | — | — | 0.76 | 10,000 |
| Macro Avg | 0.76 | 0.76 | 0.76 | 10,000 |
| Weighted Avg | 0.76 | 0.76 | 0.76 | 10,000 |
Below are example predictions generated by the model during inference:
Input:
"I really liked this video, it was very informative and entertaining!"
Output:
Input:
"This is a terrible product, I regret buying it."
Output:
This model is a RoBERTa-based sentiment analysis system fine-tuned on labeled YouTube comments. It classifies comments into Negative, Neutral, or Positive sentiment and is designed to handle informal social media language, including emojis and short expressions. The model is suitable for YouTube analytics, opinion mining, and dashboard-based sentiment monitoring, and can be easily deployed using the Hugging Face pipeline API.