Modern-FinBERT-large is a
pre-trained NLP model designed for
financial sentiment analysis. It extends the
ModernBERT-large language model by further training it on a
large financial corpus, making it highly specialized for
financial text classification.
For fine-tuning, the model leverages the
Financial PhraseBank by Malo et al. (2014), a widely recognized benchmark dataset for financial sentiment analysis.
For more technical insights on
ModernBERT, check out the research paper:
🔍
ModernBERT Technical Details
You can use this model with Transformers pipeline for sentiment analysis.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
2
3# Load the pre-trained model and tokenizer
4model = AutoModelForSequenceClassification.from_pretrained('beethogedeon/Modern-FinBERT-large', num_labels=3)
5tokenizer = AutoTokenizer.from_pretrained('beethogedeon/Modern-FinBERT-large')
6
7# Initialize the NLP pipeline
8nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
9
10sentence = "Stocks rallied and the British pound gained."
11
12print(nlp(sentence))