Views
No views yet
SmolLM)negative, neutral, positive| Model | Distilled SmolLM Sentiment Analyzer |
|---|---|
| Base Model | SmollM |
| Task | Sentiment Analysis (3-class: negative, neutral, positive) |
| Dataset | Custom Yelp Review + Distilled Dataset |
| Framework | Hugging Face Transformers |
| Distillation Method | Knowledge Distillation |
| Accuracy | ~75% (Relative Accuracy - compared with Teacher model gemma3:12b) |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("AhilanPonnusamy/distilled-smollm-sentiment-analyzer")
5model = AutoModelForSequenceClassification.from_pretrained("AhilanPonnusamy/distilled-smollm-sentiment-analyzer")
6
7inputs = tokenizer("The movie was amazing!", return_tensors="pt")
8with torch.no_grad():
9 outputs = model(**inputs)
10 logits = outputs.logits
11 predicted_class_id = logits.argmax().item()
12
13label_map = {0: "negative", 1: "neutral", 2: "positive"}
14print("Predicted sentiment:", label_map[predicted_class_id])