Downloads · 30 days
0
prithvi1029/finbert-financial-news-lora
finbert-financial-news-lora is a text classification model from prithvi1029. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains a LoRA (PEFT) adapter fine-tuned for financial news sentiment analysis using the Sentiment Analysis for Financial News (FinancialPhraseBank) dataset.
Downloads · 30 days
0
Access
Public
Updated Dec 28, 2025
Repo size
7.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors2.4 MB · 71%
From the Hugging Face model README
This repository contains a LoRA (PEFT) adapter fine-tuned for financial news sentiment analysis using the Sentiment Analysis for Financial News (FinancialPhraseBank) dataset.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel
base_id = "ProsusAI/finbert"
adapter_id = "prithvi1029/finbert-financial-news-lora"
tok = AutoTokenizer.from_pretrained(base_id)
base = AutoModelForSequenceClassification.from_pretrained(
base_id, num_labels=3
)
model = PeftModel.from_pretrained(base, adapter_id)
text = "Company shares surged after strong quarterly earnings."
inputs = tok(text, return_tensors='pt', truncation=True)
with torch.no_grad():
logits = model(**inputs).logits
pred = logits.argmax(-1).item()
print('Prediction:', pred)
This model is for research and educational purposes only and not financial advice.