Modern-FinBERT: Financial Sentiment Analysis

Modern-FinBERT 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.

Sentiment Labels

The model generates a softmax probability distribution across three sentiment categories:

  • βœ… Positive
  • ❌ Negative
  • βš– Neutral

For more technical insights on ModernBERT, check out the research paper:
πŸ” ModernBERT Technical Details

How to use

You can use this model with Transformers pipeline for sentiment analysis.

pip install -U transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline

# Load the pre-trained model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained('beethogedeon/Modern-FinBERT', num_labels=3)
tokenizer = AutoTokenizer.from_pretrained('answerdotai/ModernBERT')

# Initialize the NLP pipeline
nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)

sentence = "Stocks rallied and the British pound gained."

print(nlp(sentence))
Downloads last month
5
Safetensors
Model size
150M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for beethogedeon/Modern-FinBERT

Finetuned
(658)
this model

Dataset used to train beethogedeon/Modern-FinBERT