Update README.md
Browse files
README.md
CHANGED
@@ -16,19 +16,47 @@ tags:
|
|
16 |
- sentiment
|
17 |
- financial-sentiment-analysis
|
18 |
- sentiment-analysis
|
|
|
|
|
19 |
---
|
20 |
|
21 |
# Modern-FinBERT-large: Financial Sentiment Analysis
|
22 |
|
23 |
-
|
24 |
|
25 |
-
For fine-tuning, the model leverages the **[Financial PhraseBank](https://www.researchgate.net/publication/251231107_Good_Debt_or_Bad_Debt_Detecting_Semantic_Orientations_in_Economic_Texts)** by Malo et al. (2014), a widely
|
26 |
|
27 |
-
To
|
|
|
|
|
28 |
|
29 |
### Sentiment Labels
|
30 |
-
The model
|
31 |
|
32 |
- β
**Positive**
|
33 |
- β **Negative**
|
34 |
-
- β **Neutral**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
- sentiment
|
17 |
- financial-sentiment-analysis
|
18 |
- sentiment-analysis
|
19 |
+
widget:
|
20 |
+
- text: "Stocks rallied and the British pound gained."
|
21 |
---
|
22 |
|
23 |
# Modern-FinBERT-large: Financial Sentiment Analysis
|
24 |
|
25 |
+
[`Modern-FinBERT-large`](https://huggingface.co/answerdotai/ModernBERT-large) is a **pre-trained NLP model** designed for **financial sentiment analysis**. It extends the [`ModernBERT-large`](https://huggingface.co/answerdotai/ModernBERT-large) language model by further training it on a **large financial corpus**, making it highly specialized for **financial text classification**.
|
26 |
|
27 |
+
For fine-tuning, the model leverages the **[Financial PhraseBank](https://www.researchgate.net/publication/251231107_Good_Debt_or_Bad_Debt_Detecting_Semantic_Orientations_in_Economic_Texts)** by Malo et al. (2014), a widely recognized benchmark dataset for financial sentiment analysis.
|
28 |
|
29 |
+
To explore the research behind this model, refer to:
|
30 |
+
π **Paper:** [FinBERT: Financial Sentiment Analysis with Pre-trained Language Models](https://arxiv.org/abs/1908.10063)
|
31 |
+
π **Blog Post:** [FinBERT: Financial Sentiment Analysis with BERT](https://medium.com/prosus-ai-tech-blog/finbert-financial-sentiment-analysis-with-bert-b277a3607101)
|
32 |
|
33 |
### Sentiment Labels
|
34 |
+
The model generates a **softmax probability distribution** across three sentiment categories:
|
35 |
|
36 |
- β
**Positive**
|
37 |
- β **Negative**
|
38 |
+
- β **Neutral**
|
39 |
+
|
40 |
+
For more technical insights on `ModernBERT`, check out the research paper:
|
41 |
+
π **[ModernBERT Technical Details](https://arxiv.org/abs/2412.13663)**
|
42 |
+
|
43 |
+
# How to use
|
44 |
+
You can use this model with Transformers pipeline for sentiment analysis.
|
45 |
+
```bash
|
46 |
+
pip install -U transformers
|
47 |
+
```
|
48 |
+
|
49 |
+
```python
|
50 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
|
51 |
+
|
52 |
+
# Load the pre-trained model and tokenizer
|
53 |
+
model = AutoModelForSequenceClassification.from_pretrained('beethogedeon/Modern-FinBERT-large', num_labels=3)
|
54 |
+
tokenizer = AutoTokenizer.from_pretrained('answerdotai/ModernBERT-large')
|
55 |
+
|
56 |
+
# Initialize the NLP pipeline
|
57 |
+
nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
58 |
+
|
59 |
+
sentence = "Stocks rallied and the British pound gained."
|
60 |
+
|
61 |
+
print(nlp(sentence))
|
62 |
+
```
|