FinBERT
FinBERT is a pre-trained NLP model to analyze sentiment of financial text. It is built by further training the BERT language model in the finance domain, using a large financial corpus and thereby fine-tuning it for financial sentiment classification. Financial PhraseBank 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 and our related blog post on Medium.
The model will give softmax outputs for three labels: positive, negative or neutral.
How to use
from transformers import pipeline
classifier = pipeline("text-classification", model="ProsusAI/finbert")
classifier("Stocks rallied and the British pound gained.")
# [{'label': 'positive', 'score': 0.898...}]
To get the scores for all three labels, pass top_k=None to the classifier.
Model details
- Architecture: BERT base (12 layers, hidden size 768, 12 attention heads) with a sequence classification head
- Labels:
0positive,1negative,2neutral - Language: English
- Frameworks: weights are available for PyTorch, TensorFlow and JAX/Flax
- Code: training and prediction code is on GitHub
Training data
Training Data Attribution
This model was trained using the Financial PhraseBank dataset:
Malo, P., Sinha, A., Korhonen, P., Wallenius, J., & Takala, P. (2014). Good debt or bad debt: Detecting semantic orientations in economic texts. Journal of the Association for Information Science and Technology, 65(4), 782-796.
The Financial PhraseBank dataset is licensed under CC BY-NC-SA 3.0.
The underlying language model was further pre-trained on a subset of the Reuters TRC2 corpus, which is distributed by NIST under its own access terms.
Citation
@article{araci2019finbert,
title={FinBERT: Financial Sentiment Analysis with Pre-trained Language Models},
author={Araci, Dogu},
journal={arXiv preprint arXiv:1908.10063},
year={2019}
}
About Prosus
Prosus is a global consumer internet group and one of the largest technology investors in the world. Operating and investing globally in markets with long-term growth potential, Prosus builds leading consumer internet companies that empower people and enrich communities. For more information, please visit www.prosus.com.
📧 Contact
For questions about this research project:
- Dogu Araci: dogu.araci[at]prosus.com
- Zulkuf Genc: zulkuf.genc[at]prosus.com
Note: Questions about commercial licensing or legal permissions cannot be addressed by the research team. See the License section below.
📜 License and Usage Terms
Copyright © MIH AI B.V.
Model Weights License
The FinBERT model weights are made available under CC BY-NC-SA 4.0 (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International).
This license restricts commercial use. You may use this model for non-commercial purposes only, and any adaptations must be shared under the same license.
⚠️ User Responsibilities
You are solely responsible for:
- Ensuring your use complies with the CC BY-NC-SA 4.0 license
- Obtaining any necessary rights clearances for your specific use case
- Determining whether your intended use qualifies as "non-commercial"
- Compliance with any applicable laws and regulations
Prosus makes no representation that any particular use is permitted and does not grant rights in third-party training data.
🚫 Disclaimer
NO WARRANTY: This model is provided "AS IS" without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
NOT AN OFFICIAL PRODUCT: This is not an official Prosus product. It was created as part of a research project.
NO SUPPORT: Prosus does not provide support, maintenance, or updates for this model.
LIABILITY: In no event shall MIH AI B.V. or Prosus be liable for any claim, damages, or other liability arising from the use of this model.