--- language: "en" license: cc-by-nc-sa-4.0 tags: - financial-sentiment-analysis - sentiment-analysis - finance widget: - text: "Stocks rallied and the British pound gained." --- # 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](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. ## How to use ```python 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**: `0` positive, `1` negative, `2` neutral - **Language**: English - **Frameworks**: weights are available for PyTorch, TensorFlow and JAX/Flax - **Code**: training and prediction code is on [GitHub](https://github.com/ProsusAI/finBERT) ## 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 ```bibtex @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.