Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -6,18 +6,17 @@ tags:
|
|
| 6 |
- sentiment-analysis
|
| 7 |
- modernbert
|
| 8 |
- financial-nlp
|
| 9 |
-
- unsloth
|
| 10 |
datasets:
|
| 11 |
- neoyipeng/financial_reasoning_aggregated
|
| 12 |
metrics:
|
| 13 |
- accuracy
|
| 14 |
widget:
|
| 15 |
-
- text: The company reported strong quarterly earnings with revenue beating expectations.
|
| 16 |
-
example_title: Positive Example
|
| 17 |
-
- text: Stock prices fell sharply following disappointing guidance from management.
|
| 18 |
-
example_title: Negative Example
|
| 19 |
-
- text: The merger is expected to close in Q3 pending regulatory approval.
|
| 20 |
-
example_title: Neutral Example
|
| 21 |
---
|
| 22 |
|
| 23 |
# ModernFinBERT: Financial Sentiment Analysis
|
|
@@ -28,18 +27,29 @@ ModernFinBERT is a financial sentiment analysis model based on the ModernBERT ar
|
|
| 28 |
|
| 29 |
- **Base Model**: answerdotai/ModernBERT-base
|
| 30 |
- **Task**: 3-class sentiment classification (Negative, Neutral, Positive)
|
| 31 |
-
- **Training Data**:
|
| 32 |
- **Parameters**: 149,607,171
|
| 33 |
|
| 34 |
## Performance
|
| 35 |
|
| 36 |
-
###
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
| 39 |
|
|
|
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
|
|
|
| 43 |
```python
|
| 44 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 45 |
import torch
|
|
@@ -71,7 +81,6 @@ print(f"Sentiment: {predicted_class} ({confidence:.2f})")
|
|
| 71 |
## Citation
|
| 72 |
|
| 73 |
If you use this model, please cite:
|
| 74 |
-
|
| 75 |
```bibtex
|
| 76 |
@misc{modernfinbert2025,
|
| 77 |
title={ModernFinBERT: A Modern Approach to Financial Sentiment Analysis},
|
|
|
|
| 6 |
- sentiment-analysis
|
| 7 |
- modernbert
|
| 8 |
- financial-nlp
|
|
|
|
| 9 |
datasets:
|
| 10 |
- neoyipeng/financial_reasoning_aggregated
|
| 11 |
metrics:
|
| 12 |
- accuracy
|
| 13 |
widget:
|
| 14 |
+
- text: "The company reported strong quarterly earnings with revenue beating expectations."
|
| 15 |
+
example_title: "Positive Example"
|
| 16 |
+
- text: "Stock prices fell sharply following disappointing guidance from management."
|
| 17 |
+
example_title: "Negative Example"
|
| 18 |
+
- text: "The merger is expected to close in Q3 pending regulatory approval."
|
| 19 |
+
example_title: "Neutral Example"
|
| 20 |
---
|
| 21 |
|
| 22 |
# ModernFinBERT: Financial Sentiment Analysis
|
|
|
|
| 27 |
|
| 28 |
- **Base Model**: answerdotai/ModernBERT-base
|
| 29 |
- **Task**: 3-class sentiment classification (Negative, Neutral, Positive)
|
| 30 |
+
- **Training Data**: Vanilla sentiment tasks from multiple sources (including FinancialPhraseBank)
|
| 31 |
- **Parameters**: 149,607,171
|
| 32 |
|
| 33 |
## Performance
|
| 34 |
|
| 35 |
+
### Overall Accuracy
|
| 36 |
|
| 37 |
+
| Split | Accuracy |
|
| 38 |
+
|-------|----------|
|
| 39 |
+
| Validation | 85.3% |
|
| 40 |
+
| Test | 83.1% |
|
| 41 |
|
| 42 |
+
### Test Accuracy by Source
|
| 43 |
|
| 44 |
+
| Source | Accuracy | Correct/Total |
|
| 45 |
+
|--------|----------|---------------|
|
| 46 |
+
| 4.0 | 89.5% | 77/86 |
|
| 47 |
+
| 9.0 | 88.0% | 205/233 |
|
| 48 |
+
| 5.0 | 84.4% | 205/243 |
|
| 49 |
+
| 3.0 | 80.0% | 20/25 |
|
| 50 |
+
| 8.0 | 69.1% | 94/136 |
|
| 51 |
|
| 52 |
+
## Usage
|
| 53 |
```python
|
| 54 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 55 |
import torch
|
|
|
|
| 81 |
## Citation
|
| 82 |
|
| 83 |
If you use this model, please cite:
|
|
|
|
| 84 |
```bibtex
|
| 85 |
@misc{modernfinbert2025,
|
| 86 |
title={ModernFinBERT: A Modern Approach to Financial Sentiment Analysis},
|