Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TinySentimentClassifier
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
|
| 5 |
+
TinySentimentClassifier is a compact BERT-based model fine-tuned for sentiment analysis on English text. It classifies input text into three categories: **positive**, **neutral**, or **negative**. Designed for efficiency, it is suitable for deployment on resource-constrained environments while maintaining strong performance on standard sentiment datasets.
|
| 6 |
+
|
| 7 |
+
## Model Architecture
|
| 8 |
+
|
| 9 |
+
- **Base model**: DistilBERT (distilled version of BERT-base-uncased)
|
| 10 |
+
- **Task head**: Sequence classification head with 3 output labels
|
| 11 |
+
- **Hidden size**: 768
|
| 12 |
+
- **Number of layers**: 6
|
| 13 |
+
- **Parameters**: ~66M
|
| 14 |
+
|
| 15 |
+
The model follows the standard `BertForSequenceClassification` architecture from the Transformers library.
|
| 16 |
+
|
| 17 |
+
## Usage
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from transformers import pipeline
|
| 21 |
+
|
| 22 |
+
classifier = pipeline(
|
| 23 |
+
"sentiment-analysis",
|
| 24 |
+
model="your-username/TinySentimentClassifier",
|
| 25 |
+
return_all_scores=False
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
result = classifier("I love this product!")
|
| 29 |
+
print(result)
|
| 30 |
+
# [{'label': 'positive', 'score': 0.99}]
|