Update README.md
Browse files
README.md
CHANGED
|
@@ -17,13 +17,11 @@ widget:
|
|
| 17 |
example_title: "Positive Example"
|
| 18 |
- text: "Terrible film, complete waste of time and money."
|
| 19 |
example_title: "Negative Example"
|
| 20 |
-
- text: "It was okay, nothing special but not bad either."
|
| 21 |
-
example_title: "Neutral Example"
|
| 22 |
---
|
| 23 |
|
| 24 |
# DistilBERT Sentiment Analysis Model
|
| 25 |
|
| 26 |
-
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) for **3-class sentiment analysis** (Positive, Negative
|
| 27 |
|
| 28 |
## 🎯 Model Description
|
| 29 |
|
|
@@ -31,7 +29,7 @@ This model is a fine-tuned version of [distilbert-base-uncased](https://huggingf
|
|
| 31 |
- **Base Architecture:** DistilBERT (Distilled BERT)
|
| 32 |
- **Language:** English
|
| 33 |
- **Task:** Sentiment Analysis
|
| 34 |
-
- **Classes:**
|
| 35 |
- **Parameters:** ~66M
|
| 36 |
- **Model Size:** ~250MB
|
| 37 |
|
|
@@ -87,7 +85,7 @@ with torch.no_grad():
|
|
| 87 |
predicted_class = torch.argmax(predictions, dim=-1).item()
|
| 88 |
confidence = predictions[0][predicted_class].item()
|
| 89 |
|
| 90 |
-
labels = ["NEGATIVE",
|
| 91 |
print(f"Sentiment: {labels[predicted_class]} (Confidence: {confidence:.3f})")
|
| 92 |
```
|
| 93 |
|
|
@@ -126,9 +124,8 @@ print(f"Sentiment: {labels[predicted_class]} (Confidence: {confidence:.3f})")
|
|
| 126 |
| Validation Loss | 0.18 |
|
| 127 |
|
| 128 |
### Class Distribution
|
| 129 |
-
- **Negative:** 33.3% (
|
| 130 |
-
- **
|
| 131 |
-
- **Positive:** 33.3% (1,666 samples)
|
| 132 |
|
| 133 |
## 🎯 Intended Use
|
| 134 |
|
|
@@ -151,7 +148,6 @@ print(f"Sentiment: {labels[predicted_class]} (Confidence: {confidence:.3f})")
|
|
| 151 |
- **Domain Specificity:** Primarily trained on movie reviews, may not generalize well to other domains
|
| 152 |
- **Language:** English only, no multilingual support
|
| 153 |
- **Context Length:** Limited to 256 tokens, longer texts are truncated
|
| 154 |
-
- **Neutral Class:** Synthetic neutral samples may not represent real-world neutral sentiment accurately
|
| 155 |
- **Cultural Bias:** May reflect biases present in IMDB dataset
|
| 156 |
|
| 157 |
### Potential Biases
|
|
@@ -188,7 +184,7 @@ DistilBERT Base
|
|
| 188 |
### Output Format
|
| 189 |
```python
|
| 190 |
{
|
| 191 |
-
'label': 'POSITIVE', # One of: NEGATIVE,
|
| 192 |
'score': 0.9987 # Confidence score (0-1)
|
| 193 |
}
|
| 194 |
```
|
|
|
|
| 17 |
example_title: "Positive Example"
|
| 18 |
- text: "Terrible film, complete waste of time and money."
|
| 19 |
example_title: "Negative Example"
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
# DistilBERT Sentiment Analysis Model
|
| 23 |
|
| 24 |
+
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) for **3-class sentiment analysis** (Positive, Negative) on movie reviews.
|
| 25 |
|
| 26 |
## 🎯 Model Description
|
| 27 |
|
|
|
|
| 29 |
- **Base Architecture:** DistilBERT (Distilled BERT)
|
| 30 |
- **Language:** English
|
| 31 |
- **Task:** Sentiment Analysis
|
| 32 |
+
- **Classes:** 2 (Negative, Positive)
|
| 33 |
- **Parameters:** ~66M
|
| 34 |
- **Model Size:** ~250MB
|
| 35 |
|
|
|
|
| 85 |
predicted_class = torch.argmax(predictions, dim=-1).item()
|
| 86 |
confidence = predictions[0][predicted_class].item()
|
| 87 |
|
| 88 |
+
labels = ["NEGATIVE", POSITIVE"]
|
| 89 |
print(f"Sentiment: {labels[predicted_class]} (Confidence: {confidence:.3f})")
|
| 90 |
```
|
| 91 |
|
|
|
|
| 124 |
| Validation Loss | 0.18 |
|
| 125 |
|
| 126 |
### Class Distribution
|
| 127 |
+
- **Negative:** 33.3% (2500 samples)
|
| 128 |
+
- **Positive:** 33.3% (2500 samples)
|
|
|
|
| 129 |
|
| 130 |
## 🎯 Intended Use
|
| 131 |
|
|
|
|
| 148 |
- **Domain Specificity:** Primarily trained on movie reviews, may not generalize well to other domains
|
| 149 |
- **Language:** English only, no multilingual support
|
| 150 |
- **Context Length:** Limited to 256 tokens, longer texts are truncated
|
|
|
|
| 151 |
- **Cultural Bias:** May reflect biases present in IMDB dataset
|
| 152 |
|
| 153 |
### Potential Biases
|
|
|
|
| 184 |
### Output Format
|
| 185 |
```python
|
| 186 |
{
|
| 187 |
+
'label': 'POSITIVE', # One of: NEGATIVE, POSITIVE
|
| 188 |
'score': 0.9987 # Confidence score (0-1)
|
| 189 |
}
|
| 190 |
```
|