Downloads · 30 days
24
2% of all-time downloads
roma2025/FinLlama-3-8B
FinLlama-3-8B is a text classification model from roma2025. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as llama3.
This model card provides details for the FinLlama-3-8B model, which is fine-tuned for sentiment analysis on financial tweets and phrases.
Downloads · 30 days
24
2% of all-time downloads
All-time downloads
1.1K
Public
Repo size
109 MB
Likes
1
Public
Click a slice to open those files.
.safetensors109 MB · 92%
From the Hugging Face model README
This model card provides details for the FinLlama-3-8B model, which is fine-tuned for sentiment analysis on financial tweets and phrases.
FinLlama-3-8B is a fine-tuned version of the Llama-3-8B model specifically tailored for sentiment analysis in the financial domain. It can classify text into three sentiment categories: positive, neutral, and negative.
FinLlama-3-8B can be directly used for sentiment analysis on financial text, providing sentiment labels (positive, neutral, negative) for given inputs.
The model can be integrated into larger financial analysis systems to provide sentiment insights as part of broader financial data analytics.
This model is not suitable for non-financial text sentiment analysis or for languages other than English.
Users should be aware of potential biases in the training data, which may affect the model's performance on certain subpopulations or topics. Continuous monitoring and evaluation are recommended.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("roma2025/FinLlama-3-8B")
tokenizer = AutoTokenizer.from_pretrained("roma2025/FinLlama-3-8B")
def get_sentiment_score(model, tokenizer, text):
inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True, max_length=75)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probabilities = F.softmax(logits, dim=-1)
sentiment_score = torch.argmax(probabilities, dim=-1).item()
return sentiment_score, probabilities
# Example usage
text = "Determine the sentiment of the financial news as negative, neutral or positive:
The stock market is going up!
Sentiment:"
sentiment_score, probabilities = get_sentiment_score(model, tokenizer, text)