Downloads · 30 days
61
0% of all-time downloads
peejm/finbert-financial-sentiment
finbert-financial-sentiment is a text classification model from peejm. Use it when you need a label for a piece of text. The card lists the license as mit.
This is a bert-base-uncased model fine-tuned on the Financial PhraseBank dataset for sentiment analysis of financial news.
Downloads · 30 days
61
0% of all-time downloads
All-time downloads
19.8K
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This is a bert-base-uncased model fine-tuned on the Financial PhraseBank dataset for sentiment analysis of financial news.
This model was trained as part of the project available at https://github.com/jp-marques/financial-sentiment-analysis.
This model is a fine-tuned version of ProsusAI/finbert for financial sentiment analysis. It classifies financial headlines into three categories: positive, negative, or neutral. The model achieves an accuracy of 80.8% on the test set, with a particularly strong F1-score of 50% for the negative class, which is crucial for risk detection.
This model is intended for analyzing the sentiment of financial news headlines, articles, and social media posts. It can be used to generate trading signals, assess market sentiment, or perform risk analysis.
Limitations:
You can use this model directly with a pipeline from the transformers library.
from transformers import pipeline
classifier = pipeline('sentiment-analysis', model="peejm/finbert-financial-sentiment")
text = "Stocks are soaring after the positive earnings report."
result = classifier(text)
print(result)
# [{'label': 'positive', 'score': 0.99...}]
The model was fine-tuned on a Kaggle dataset, which contains sentences from financial news categorized by sentiment.
The data was split into training, validation, and test sets as detailed in the EDA notebook of the original project.
The model was fine-tuned using the Trainer API from the Hugging Face transformers library. The hyperparameters and training script can be found in the notebook 03_finetune_finbert.ipynb in the project repository.
| Metric | Value |
|---|---|
| Accuracy | 80.8% |
| F1 Score (Negative) | 50% |
These results represent a significant improvement over baseline models, as detailed in the project's main README.md.