YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

FinBERT Financial Sentiment Classification Model Description Purpose: This model is a fine-tuned version of BERT, adapted for financial sentiment classification. It is specifically designed to classify financial text into categories like positive, negative, and neutral. Architecture: Based on the BERT architecture, this model has been fine-tuned on financial texts, optimizing it for use in sentiment analysis within the finance sector. Training Data: The model was trained on a financial dataset containing news headlines, analyst reports, and other finance-related text sources, labeled for sentiment. Intended Use Cases: Ideal for applications in finance, such as analyzing news articles, earnings reports, and social media for sentiment to aid in investment analysis, trading decisions, or financial forecasting. Framework: PyTorch with Hugging Face Transformers

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("heroiclunatic/finbert-finance-classification")
model = AutoModelForSequenceClassification.from_pretrained("heroiclunatic/finbert-finance-classification")

# Sample text
text = "Elon musk reports that all the board of directors of tesla resign"

# Preprocess text
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

# Get sentiment scores
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()
labels = ["Negative", "Neutral", "Positive"]
print(f"Sentiment: {labels[predicted_class]}")
Downloads last month
3
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support