ModernFinBERT is a financial sentiment analysis model based on the
ModernBERT architecture (149M parameters). It classifies financial text into three sentiment categories:
NEGATIVE,
NEUTRAL, and
POSITIVE.
1from transformers import pipeline
2
3classifier = pipeline("text-classification", model="neoyipeng/ModernFinBERT-base")
4
5result = classifier("The company reported strong quarterly earnings, beating analyst expectations.")
6print(result)
7# [{'label': 'POSITIVE', 'score': 0.95}]
1texts = [
2 "Revenue declined 15% year-over-year due to market headwinds.",
3 "The board approved a new share buyback program.",
4 "The company maintained its quarterly dividend at $0.50 per share.",
5]
6
7results = classifier(texts)
8for text, result in zip(texts, results):
9 print(f"{result['label']} ({result['score']:.2f}): {text[:60]}...")
The model was trained on the complete
neoyipeng/financial_reasoning_aggregated dataset including FinancialPhraseBank, augmented with 410 DataBoost samples generated via Verbalized Sampling.
1@article{neo2026modernfinbert,
2 title={ModernFinBERT: A Systematic Study of ModernBERT for Financial Sentiment Analysis},
3 author={Neo, Yipeng},
4 journal={arXiv preprint},
5 year={2026}
6}
For full experimental details, evaluation protocols, and analysis, see the
ModernFinBERT paper.