Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -3,6 +3,48 @@ library_name: transformers
|
|
| 3 |
tags: []
|
| 4 |
---
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
@@ -196,4 +238,4 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
| 196 |
|
| 197 |
## Model Card Contact
|
| 198 |
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 3 |
tags: []
|
| 4 |
---
|
| 5 |
|
| 6 |
+
# ModernBERT Fine-tuned for IMDB Sentiment Analysis
|
| 7 |
+
|
| 8 |
+
This model is a fine-tuned version of `answerdotai/ModernBERT-base` for sentiment analysis on the IMDB movie review dataset.
|
| 9 |
+
|
| 10 |
+
## Dataset
|
| 11 |
+
|
| 12 |
+
The model was fine-tuned on a subset of the [IMDB dataset](https://huggingface.co/datasets/imdb).
|
| 13 |
+
|
| 14 |
+
- **Training Split Size:** 5000 samples
|
| 15 |
+
- **Validation Split Size:** 12500 samples
|
| 16 |
+
- **Test Split Size:** 1000 samples
|
| 17 |
+
|
| 18 |
+
## Evaluation Results
|
| 19 |
+
|
| 20 |
+
The model was evaluated on the validation set after training. The key metrics are:
|
| 21 |
+
|
| 22 |
+
- **Validation Loss:** 0.1587
|
| 23 |
+
- **Validation Accuracy:** 0.9478
|
| 24 |
+
- **Validation F1-score (macro):** 0.9488
|
| 25 |
+
|
| 26 |
+
The best model checkpoint was saved at step 300.
|
| 27 |
+
|
| 28 |
+
## Usage
|
| 29 |
+
|
| 30 |
+
You can use this model for text classification (sentiment analysis) using the Hugging Face `pipeline`:
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from transformers import pipeline
|
| 34 |
+
|
| 35 |
+
model_id = "Hugging-GK/ModerBert-MultiClass-IMDB-imdb_complete_data"
|
| 36 |
+
sentiment_pipeline = pipeline("text-classification", model=model_id)
|
| 37 |
+
|
| 38 |
+
text = "This movie was fantastic!"
|
| 39 |
+
result = sentiment_pipeline(text)
|
| 40 |
+
print(result)
|
| 41 |
+
|
| 42 |
+
text = "This movie was terrible."
|
| 43 |
+
result = sentiment_pipeline(text)
|
| 44 |
+
print(result)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
|
| 48 |
# Model Card for Model ID
|
| 49 |
|
| 50 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
| 238 |
|
| 239 |
## Model Card Contact
|
| 240 |
|
| 241 |
+
[More Information Needed]
|