đ Model Card: SSAF-FinBert
The SSAF-FinBert model is a specialized tool for sentiment analysis of stock market news articles, offering accurate sentiment classification.
đ Quick Start
The SSAF-FinBert model is a fine - tuned version of the FinBert model. It's designed to classify the sentiment in financial text data into positive, negative, and neutral categories.
⨠Features
- Sentiment Classification: Classifies financial text sentiment into positive, negative, or neutral.
- High Accuracy: Achieved an accuracy of 81% - 82% on different training platforms.
đĻ Installation
To access the SSAF - FinBert model for sentiment analysis, you can use the following Python code:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained('yiyanghkust/finbert-pretrain')
model_path = "likith123/SSAF-FinBert"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
def predict_sentiment(input_text):
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predicted_probs = torch.softmax(outputs.logits, dim=1).squeeze().tolist()
return predicted_probs
đģ Usage Examples
Basic Usage
text_data = "This is a positive news article about the stock market."
predicted_sentiment = predict_sentiment(text_data)
print(predicted_sentiment)
The predicted_sentiment
variable will contain a list of probabilities corresponding to each sentiment class, allowing you to analyze the sentiment expressed in the input text.
đ Documentation
Labels Mapping
In Inference API Labels Mapping:
- Label_0 = Negative
- Label_1 = Neutral
- Label_2 = Positive
Finetuning Process
Access the Code for finetuning Kaggle Notebook.
Access the WebAPP StreamLit APP.
Performance and Limitations
The SSAF - FinBert model has demonstrated strong performance in sentiment analysis tasks related to financial text data. However, it is essential to note that the model's accuracy may vary depending on the nature and complexity of the input text. While the model excels in classifying sentiment in financial news articles, it may not perform optimally in other domains or with highly specialized financial terminology.
đ License
This project is licensed under the MIT license.
Acknowledgments
The development of the SSAF - FinBert model was made possible through the contributions of the open - source community and the resources provided by Hugging Face. We extend our gratitude to the developers and researchers who have contributed to the development and improvement of transformer - based models for natural language processing tasks.
For more information and updates on the SSAF - FinBert model, please refer to the model card.