Indian FinBERT β€” LoRA Fine-tuned Adapter

FinBERT (ProsusAI/finbert) fine-tuned on Indian financial news headlines using LoRA adapters.
Optimised for Indian market sentiment β€” Nifty 50 stocks, NSE/BSE news, RBI announcements, and Indian business headlines.


What's in this repo

This repo contains the weights file for the fine-tuned model, the data it is fine-tuned on and the merged model itself.

This repository contains everything needed to use, evaluate, or continue training this model. It includes the raw LoRA adapter weights, the underlying dataset metadata configurations, and the fully integrated standalone weights:

β”œβ”€β”€ config.json                     # Merged model configuration
β”œβ”€β”€ model.safetensors               # Full merged standalone weights (~440 MB)
β”œβ”€β”€ adapter_config.json             # LoRA adapter configuration metadata
β”œβ”€β”€ adapter_model.safetensors       # Isolated LoRA adapter weights (~15 MB)
β”œβ”€β”€ tokenizer_config.json           # Tokenizer settings
β”œβ”€β”€ tokenizer.json                  # Tokenizer vocabulary configuration
└── README.md                       # Model card & documentation

Labels

ID Label Meaning
0 POSITIVE Bullish sentiment
1 NEGATIVE Bearish sentiment
2 NEUTRAL No clear directional signal

Setup

2. Create a virtual environment

python -m venv .venv

# Linux / macOS
source .venv/bin/activate

# Windows
.venv\Scripts\activate

3. Install dependencies

pip install torch==2.6.0 transformers==4.47.0 peft==0.13.0 safetensors==0.4.3

Have an NVIDIA GPU? Install the CUDA build of torch for faster inference:

pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu124
pip install transformers==4.47.0 peft==0.13.0 safetensors==0.4.3

Option A β€” Production / Standalone Inference (Recommended)

Because the weights are fully merged into this repository, you do not need the peft library at runtime. You can load it natively using a standard Hugging Face pipeline wrapper.

import torch
from transformers import pipeline

# Replace with your actual HF username/repo-name
MODEL_REPO = "your-username/your-repo-name" 

nlp = pipeline(
    "sentiment-analysis",
    model=MODEL_REPO,
    tokenizer=MODEL_REPO,
    device=0 if torch.cuda.is_available() else -1
)

LABEL_MAP = {"LABEL_0": "POSITIVE πŸ“ˆ", "LABEL_1": "NEGATIVE πŸ“‰", "LABEL_2": "NEUTRAL ➑️"}

headlines = [
    "Adani Group stocks rally after court clears fraud allegations.",
    "RBI raises repo rate by 50 basis points amid inflation.",
    "Markets remain flat ahead of Union Budget announcement.",
]

for h in headlines:
    result = nlp(h)[0]
    label = LABEL_MAP.get(result["label"], result["label"])
    print(f"  {label} ({result['score']*100:.1f}%) β€” {h}")

Requirements

torch>=2.6.0
transformers==4.47.0
peft==0.13.0
safetensors==0.4.3
pandas>=2.2.0          # only needed for batch CSV inference

Model details

Property Value
Base model ProsusAI/finbert
Fine-tuning method LoRA (PEFT)
LoRA rank 32
LoRA alpha 64
Target modules query, value
Training data Indian financial news headlines
Task 3-class sentiment classification
Labels Positive / Negative / Neutral
Trainable parameters ~1% of total

License

The adapter weights in this repository are released under the MIT License.
The base model (ProsusAI/finbert) is subject to its own Apache 2.0 license.

Downloads last month
36
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