File size: 1,540 Bytes
705829f 6b0f757 057a224 0cd5d1a |
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 |
---
license: mit
language:
- en
base_model:
- huawei-noah/TinyBERT_General_4L_312D
pipeline_tag: text-classification
tags:
- sentiment-analysis
- tinybert
- transformers
- text-classification
- imdb
---
#
# π¦ TinyBERT IMDB Sentiment Analysis Model
This is a fine-tuned [TinyBERT](https://huggingface.co/huawei-noah/TinyBERT_General_4L_312D) model for binary **sentiment classification** on a 5,000-sample subset of the [IMDB dataset](https://huggingface.co/datasets/imdb).
It predicts whether a movie review is **positive** or **negative**.
## π§ Model Details
- **Base model:** [`huawei-noah/TinyBERT_General_4L_312D`](https://huggingface.co/huawei-noah/TinyBERT_General_4L_312D)
- **Task:** Sentiment Classification (Binary)
- **Dataset:** 4,000 training + 1,000 test samples from IMDB
- **Tokenizer:** `AutoTokenizer.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')`
- **Max length:** 300 tokens
- **Batch size:** 64
- **Training framework:** Hugging Face `Trainer`
- **Device:** A100 GPU
## π Evaluation Metrics
## π Evaluation Metrics (on 1,000-sample test set)
| Metric | Value |
|-----------------------|----------|
| Accuracy | **88.02%** |
| Evaluation Loss | 0.2962 |
| Runtime | 30.9 sec |
| Samples per Second | 485 |
## π How to Use
```python
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Harsha901/tinybert-imdb-sentiment-analysis-model"
)
result = classifier("This movie was absolutely amazing!")
print(result) # [{'label': 'LABEL_1', 'score': 0.98}] |