Update readme
Browse files---
widget:
- text: "growth is strong and we have plenty of liquidity"
---
`Modern-FinBERT-large` is a pre-trained NLP model to analyze sentiment of financial text. It is built by further training the [ModernBERT-large](https://huggingface.co/answerdotai/ModernBERT-large) language model in the finance domain, using a large financial corpus and thereby fine-tuning it for financial sentiment classification. [Financial PhraseBank](https://www.researchgate.net/publication/251231107_Good_Debt_or_Bad_Debt_Detecting_Semantic_Orientations_in_Economic_Texts) by Malo et al. (2014) is used for fine-tuning. For more details, please see the paper [FinBERT: Financial Sentiment Analysis with Pre-trained Language Models](https://arxiv.org/abs/1908.10063) and our related [blog post](https://medium.com/prosus-ai-tech-blog/finbert-financial-sentiment-analysis-with-bert-b277a3607101) on Medium.
The model will give softmax outputs for three labels: positive, negative or neutral.
More technical details on `ModernBERT`: [Click Link](https://arxiv.org/abs/2412.13663)
# How to use
You can use this model with Transformers pipeline for sentiment analysis.
```bash
pip install -U transformers
```
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
# Load the pre-trained model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained('beethogedeon/Modern-FinBERT-large', num_labels=3)
tokenizer = AutoTokenizer.from_pretrained('answerdotai/ModernBERT-large')
# Initialize the NLP pipeline
nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
sentence = "Stocks rallied and the British pound gained."
print(nlp(sentence))
```
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- takala/financial_phrasebank
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
metrics:
|
8 |
+
- f1
|
9 |
+
base_model:
|
10 |
+
- answerdotai/ModernBERT-large
|
11 |
+
new_version: ProsusAI/finbert
|
12 |
+
pipeline_tag: text-classification
|
13 |
+
library_name: transformers
|
14 |
+
tags:
|
15 |
+
- finance
|
16 |
+
- sentiment
|
17 |
+
- financial-sentiment-analysis
|
18 |
+
- sentiment-analysis
|
19 |
+
---
|