Views
No views yet
bert-base-uncased model - sh7vashrestha/BertBaseUncased-SenetimentAnalysis. It preserves most of the teacher's performance while significantly reducing model size and computational requirements. The student model was trained using behavioral knowledge distillation:| Component | Configuration |
|---|---|
| Layers | 4 |
| Hidden Size | 312 |
| Attention Heads | 6 |
| Feedforward Size | 1024 |
| Dropout | 0.2 |
| Parameters | ~13.9M |
| File Size | ~54MB |
| Distillation Loss | Accuracy | F1 Score |
|---|---|---|
| KLD | 86.30% | 86.23% |
1from transformers import BertForSequenceClassification, BertTokenizer
2
3tokenizer = BertTokenizer.from_pretrained("sh7vashrestha/Bert_Small_13M_SentimentalAnalysis")
4model = BertForSequenceClassification.from_pretrained("sh7vashrestha/Bert_Small_13M_SentimentalAnalysis")
5
6inputs = tokenizer("I absolutely loved the movie!", return_tensors="pt")
7outputs = model(**inputs)
8prediction = outputs.logits.argmax(dim=1)
9print(prediction)
10label_mapping = {0: "negative", 1: "positive"}
11prediction_label = label_mapping[prediction.item()]
12print(prediction_label)