← Back to portfolio
Case Study · 04 / 17
NLP · Machine Learning · 2024

Reading the tone of
financial headlines.

A single pipeline that classifies banking, financial-services, and insurance news headlines as positive, negative, or neutral — and pits classical ML, gradient-boosted ensembles, and BERT against each other on exactly the same data. This is what the comparison actually taught me.

Role
Solo build — NLP & modelling
Context
GenAI BFSI hackathon
Stack
scikit-learn · XGBoost · LightGBM · BERT
Status
Notebook-based project
Fig. 04 · positive / negative / neutral
04
The same three labels, chased by six kinds of model.
§ 01 — The problem

Financial sentiment is its own dialect.

"Bank misses estimates" is negative; "regulator eases capital rules" is positive — and a general-purpose sentiment model, trained on movie reviews and tweets, has no idea. BFSI language is terse, domain-loaded, and full of words that mean the opposite of their everyday sense.

The task was to classify sector headlines into positive, negative, and neutral, and — just as importantly — to find out which family of model earns its cost here. Is a fine-tuned transformer worth the training time over a well-tuned gradient-boosted classifier?

The best model is the one whose cost you can justify.

§ 02 — Constraints

Keeping the comparison fair.

§ 03 — Architecture

Clean, vectorise, model, ensemble.

The workflow runs in a single notebook: exploratory analysis and word clouds, then a text pipeline, then a ladder of models from logistic regression up to a fine-tuned BERT, with voting and stacking on top.

01 — Explore
EDA
Sentiment distribution, text stats, word clouds, duplicate + missing checks.
02 — Vectorise
TF-IDF
TF-IDF with n-grams over domain-cleaned text; features engineered for BFSI.
03 — Model
LR → XGB → BERT
Logistic, RF, SVM, XGBoost, LightGBM, MLPs and a BERT fine-tune.
04 — Combine
Ensemble
Voting + stacking, with confidence scoring and multi-model consensus.

Prediction works two ways: a single headline returns a label and a confidence, and a batch returns a consensus across the top models — a small hedge against any one classifier's blind spot.

§ 04 — What the numbers said

BERT wins on accuracy, ensembles win on value.

The headline result: ensemble methods reached roughly 94–96% accuracy, and a fine-tuned BERT nudged slightly higher — at the cost of by far the longest training time. XGBoost and LightGBM landed in the low-90s while training in a fraction of the time.

For most of this dataset, the gradient-boosted ensemble was the sweet spot: nearly BERT-level accuracy, a small fraction of the compute, and far easier to reason about. BERT earned its keep only on the genuinely ambiguous headlines.

~95%
Accuracy from voting / stacking ensembles
6+
Model families compared on one pipeline
3
Sentiment classes — positive, negative, neutral
§ 05 — What earned its keep

Preprocessing beat model swaps.

The single biggest accuracy jump didn't come from a fancier model — it came from the domain-specific cleaning. Financial stopwords and careful n-gram features lifted every model at once, which is a cheaper and more durable win than chasing the next architecture.

Feature-importance analysis then paid that back in interpretability: you could point at the exact financial terms driving a prediction, which matters more in a regulated domain than a half-point of accuracy.

§ 06 — What I'd do differently

Three things, next time.