Instructions to use ArpitJha/Indian-FinBert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArpitJha/Indian-FinBert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ArpitJha/Indian-FinBert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ArpitJha/Indian-FinBert") model = AutoModelForSequenceClassification.from_pretrained("ArpitJha/Indian-FinBert") - Notebooks
- Google Colab
- Kaggle
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