beethogedeon commited on
Commit
672f2ed
Β·
verified Β·
1 Parent(s): b169958

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -5
README.md CHANGED
@@ -13,17 +13,61 @@ metrics:
13
  tags:
14
  - finance
15
  ---
16
- # Modern-FinBERT : Financial Sentiment Analysis
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- **Modern-FinBERT** 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.
19
 
20
- 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.
21
 
22
- 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.
23
 
24
  ### Sentiment Labels
25
- The model outputs a **softmax distribution** across three sentiment labels:
26
 
27
  - βœ… **Positive**
28
  - ❌ **Negative**
29
  - βš– **Neutral**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  tags:
14
  - finance
15
  ---
16
+ ---
17
+ license: apache-2.0
18
+ datasets:
19
+ - takala/financial_phrasebank
20
+ language:
21
+ - en
22
+ metrics:
23
+ - f1
24
+ base_model:
25
+ - answerdotai/ModernBERT-large
26
+ new_version: ProsusAI/finbert
27
+ pipeline_tag: text-classification
28
+ library_name: transformers
29
+ tags:
30
+ - finance
31
+ - sentiment
32
+ - financial-sentiment-analysis
33
+ - sentiment-analysis
34
+ widget:
35
+ - text: "Stocks rallied and the British pound gained."
36
+ ---
37
 
38
+ # Modern-FinBERT: Financial Sentiment Analysis
39
 
40
+ `Modern-FinBERT` 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**.
41
 
42
+ 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.
43
 
44
  ### Sentiment Labels
45
+ The model generates a **softmax probability distribution** across three sentiment categories:
46
 
47
  - βœ… **Positive**
48
  - ❌ **Negative**
49
  - βš– **Neutral**
50
+
51
+ For more technical insights on `ModernBERT`, check out the research paper:
52
+ πŸ” **[ModernBERT Technical Details](https://arxiv.org/abs/2412.13663)**
53
+
54
+ # How to use
55
+ You can use this model with Transformers pipeline for sentiment analysis.
56
+ ```bash
57
+ pip install -U transformers
58
+ ```
59
+
60
+ ```python
61
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
62
+
63
+ # Load the pre-trained model and tokenizer
64
+ model = AutoModelForSequenceClassification.from_pretrained('beethogedeon/Modern-FinBERT', num_labels=3)
65
+ tokenizer = AutoTokenizer.from_pretrained('answerdotai/ModernBERT')
66
+
67
+ # Initialize the NLP pipeline
68
+ nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
69
+
70
+ sentence = "Stocks rallied and the British pound gained."
71
+
72
+ print(nlp(sentence))
73
+ ```