beethogedeon commited on
Commit
329111f
Β·
verified Β·
1 Parent(s): 8cd51c5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -5
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
- **Modern-FinBERT-large** is a state-of-the-art NLP model designed for **financial sentiment analysis**. It extends the **ModernBERT** language model by further training it on a vast financial corpus, ensuring domain-specific accuracy. This additional training fine-tunes the model for **sentiment classification** in financial texts.
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 used benchmark dataset in financial NLP.
26
 
27
- To learn more, refer to the research paper **[FinBERT: Financial Sentiment Analysis with Pre-trained Language Models](https://arxiv.org/abs/1908.10063)** and our in-depth **[blog post](https://medium.com/prosus-ai-tech-blog/finbert-financial-sentiment-analysis-with-bert-b277a3607101)** on Medium.
 
 
28
 
29
  ### Sentiment Labels
30
- The model outputs a **softmax distribution** across three sentiment labels:
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
+ ```