CoolFace
Modelpublic

Sashank1006/finance-sentiment-mistral-lora

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes7downloads
Model Card

๐Ÿ’น Finance Sentiment Classifier โ€” Indian Market Focus

Fine-tuned on Mistral-7B-Instruct using LoRA via Adaption AutoScientist. Classifies financial news, headlines, and social media text into positive, negative, or neutral sentiment. Built for the HackIndia Adaption AutoScientist Challenge โ€” Finance track.

๐Ÿ“Š Performance

MetricBase ModelOur ModelImprovement
Win Rate (our dataset)4456+27% relative
Win Rate (market analysis category)4060+50% relative
Dataset quality gradeE (2.0)B (8.1)+305% relative

Training curves showed clean, consistent loss reduction with no overfitting across 4 epochs.


๐Ÿง  Model Details

PropertyValue
Base modelmistralai/Mistral-7B-Instruct-v0.3
Training methodSupervised Fine-Tuning (SFT) + LoRA
LoRA rank64
LoRA alpha128
Target layersqproj, kproj, vproj, oproj
Epochs4
OptimizerCosine LR scheduler
Warmup ratio0.05
Gradient clipping1.0
Weight decay0.01
Training platformAdaption AutoScientist
Dataset size20,000 rows (adapted)

๐Ÿ“ Dataset

The training dataset is a curated merge of 6 sources totalling ~120,000 raw rows, cleaned and deduplicated down to 20,000 high-quality rows via Adaption's Adaptive Data pipeline.

Sources

SourceTypeRows (approx)
financialphrasebank (sentencesallagree)Human-labeled news sentences~2,200
zeroshot/twitter-financial-news-sentimentHuman-labeled financial tweets~9,900
flwrlabs/fingpt-sentiment-trainFinancial NLP training data~76,800
TimKoornstra/financial-tweets-sentimentHuman-labeled financial tweets~38,000
nickmuchi/financial-classificationFinancial text classification~2,000
Hand-labeled originals (Indian market)Original, manually written examples~60+
NewsAPI live headlinesRule-labelled recent business news~500

What makes this dataset original

  • โ€”Indian market focus โ€” original hand-labeled examples covering NSE, BSE, Sensex, Nifty, RBI decisions, Indian fintech (Paytm, Zomato, PhonePe), and Indian conglomerates (Reliance, Tata, Adani, HDFC)
  • โ€”Multi-source deduplication โ€” priority-aware deduplication ensures highest-quality copy is retained when the same text appears across sources
  • โ€”Multilingual context โ€” includes financial terminology specific to the Indian subcontinent not present in standard Western finance NLP datasets
  • โ€”Live news augmentation โ€” recent business headlines via NewsAPI add temporal diversity beyond static datasets

Label distribution (after cleaning)

positive :  ~35%
negative :  ~33%
neutral  :  ~32%

Balanced across all three classes to prevent label bias.

Data quality improvement via Adaptive Data

Adaption's Adaptive Data pipeline was applied before training:

  • โ€”Before: Grade E, quality score 2.0, percentile 0.1
  • โ€”After: Grade B, quality score 8.1, percentile 17.8
  • โ€”Relative improvement: 305%

๐Ÿš€ How to Use

python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model = "mistralai/Mistral-7B-Instruct-v0.3"
lora_model  = "Sashank1006/finance-sentiment-mistral-lora"

tokenizer = AutoTokenizer.from_pretrained(base_model)
model     = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
model     = PeftModel.from_pretrained(model, lora_model)
model.eval()

def predict_sentiment(text: str) -> str:
    prompt = f"Classify the sentiment of this financial text as positive, negative, or neutral:\n\n{text}\n\nSentiment:"
    inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
    output = model.generate(**inputs, max_new_tokens=5, do_sample=False)
    result = tokenizer.decode(output[0], skip_special_tokens=True)
    return result.split("Sentiment:")[-1].strip().lower()

# Example
text = "Reliance Industries reported a 23% jump in quarterly profit."
print(predict_sentiment(text))  # โ†’ "positive"

๐ŸŒ Real-World Applications

  • โ€”Retail investor tools โ€” classify financial news before displaying to users
  • โ€”Trading signal generation โ€” convert news sentiment into bullish/bearish signals
  • โ€”Portfolio risk monitoring โ€” flag negative sentiment around held stocks
  • โ€”Indian fintech apps โ€” specifically tuned for Indian market terminology and companies
  • โ€”News aggregators โ€” auto-tag financial articles by sentiment

โš ๏ธ Limitations

  • โ€”Trained primarily on English-language financial text; performance on Hindi/Tamil/regional language finance text will be lower
  • โ€”Rule-labelled NewsAPI headlines (~500 rows) may contain some label noise
  • โ€”Model may underperform on highly technical financial derivative or options-specific language
  • โ€”Sentiment is classified at the sentence/headline level โ€” document-level sentiment aggregation requires additional logic
  • โ€”The model reflects sentiment patterns in training data up to mid-2026; sentiment around newer entities may be less accurate

๐Ÿ“‹ Training Pipeline

Raw data (6 sources, ~120K rows)
        โ†“
Merge + deduplicate (prepare_dataset.py)
        โ†“
Upload to Adaption Adaptive Data
        โ†“
Adaptive Data optimization (Grade E โ†’ B, 305% quality improvement)
        โ†“
AutoScientist fine-tuning (Mistral-7B-Instruct, LoRA, 4 epochs)
        โ†“
Evaluation (Win rate: 44 โ†’ 56 on dataset, 40 โ†’ 60 on market analysis)
        โ†“
Released on HuggingFace + Kaggle

๐Ÿ‘ฅ Team

Team Caribou โ€” HackIndia Adaption AutoScientist Challenge, Finance Track

Built using:

  • โ€”Adaption AutoScientist โ€” automated model training
  • โ€”Adaption Adaptive Data โ€” dataset quality optimization
  • โ€”HuggingFace Datasets โ€” source data
  • โ€”NewsAPI โ€” live headline augmentation

๐Ÿ“„ Citation

bibtex
@misc{caribou2026financeSentiment,
  title  = {Finance Sentiment Classifier โ€” Indian Market Focus},
  author = {Team Caribou},
  year   = {2026},
  url    = {https://huggingface.co/YOUR_HF_USERNAME/finance-sentiment-mistral-lora},
  note   = {Built for HackIndia Adaption AutoScientist Challenge}
}

๐Ÿ”— Links