Built to order

Marathi News Classification using IndicBERT

This project fine-tunes IndicBERT — AI4Bharat's transformer pretrained on 12 Indian languages — to classify Marathi news headlines and articles into topic categories. It works directly on Devanagari script with no transliteration, handles class imbalance with weighted loss, and is evaluated on the L3Cube MahaNews corpus with per-class F1 scores. A web demo classifies any Marathi headline live with a full probability distribution. The training notebook, evaluation and viva kit are fully documented. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.

Marathi News Classification using IndicBERT — project thumbnail preview
More project photos (2)

The problem

Most NLP research targets English, leaving Indian languages with far fewer ready-made tools — yet Marathi is spoken by over 80 million people and generates enormous daily news text. Classifying that text by topic is the backbone of news aggregators, recommendation feeds and media monitoring, but off-the-shelf English models fail on Devanagari script and Marathi morphology. This project tackles the problem properly: IndicBERT, pretrained on 12 Indian languages including Marathi, is fine-tuned on the L3Cube MahaNews corpus for topic classification. The pipeline covers Devanagari normalization, stratified splitting, class-weighted training to survive the long tail of rare categories, and early stopping on validation macro-F1. The demo takes any Marathi headline and returns its predicted category with confidence scores across all classes.

How it works

  1. The MahaNews corpus is loaded and normalized: Devanagari unicode normalization, punctuation cleanup, headline plus article-lead joined as input.
  2. Data is split 80/10/10 with stratification so every topic category is represented in train, validation and test.
  3. IndicBERT is fine-tuned for 5 epochs with a classification head, class-weighted cross-entropy, and early stopping on validation macro-F1.
  4. The test split is evaluated once: accuracy, macro-F1 and per-class precision/recall/F1 are recorded for the report.
  5. A confusion matrix highlights category pairs the model mixes (typically politics vs business on policy news).
  6. The demo tokenizes a new headline identically, runs the saved model, and renders the softmax distribution over categories.

Tech stack:

  • Python 3, PyTorch
  • Hugging Face Transformers
  • IndicBERT (AI4Bharat)
  • IndicNLP tokenizer
  • scikit-learn (metrics)
  • HTML/CSS/JS demo
  • L3Cube MahaNews corpus

Dataset & model details

  • Dataset: L3Cube MahaNews — Marathi news headlines and articles with topic labels, released by L3Cube (Pune); the long-document-classification (LDC) split carries 12 topic classes.
  • Task: Text classification; input = Marathi headline/article text in Devanagari, output = probability distribution over topic categories (6 demo classes, 12 full).
  • Model: IndicBERT (ALBERT-based, pretrained on 12 Indian languages by AI4Bharat, IIT Madras) fine-tuned with a linear classification head; class-weighted cross-entropy.
  • Metrics: Macro-F1 design target 89.4%, accuracy design target 91.2% on the MahaNews test split; per-class F1 reported (lowest: health, 0.78 design target). No metric is claimed as measured until the fine-tuning run is executed for the order.
Parameter Value
Input Marathi text in Devanagari script (headline or headline + lead)
Classes 6 demo classes (12 in full LDC label set)
Model IndicBERT base, fine-tuned (design run)
Macro-F1 89.4% (design target, not a measured claim)
Accuracy 91.2% (design target)
Training Approximately 5 epochs, early stopping (expected)
Inference Approximately 12 ms per headline on CPU (expected)
Demo Single-file web app, Devanagari UI

Project features

  • [IndicBERT fine-tuning] AI4Bharat's ALBERT-based multilingual model fine-tuned with a classification head for Marathi topics.
  • [Native Devanagari pipeline] IndicNLP tokenization and script normalization — no lossy transliteration to Latin script.
  • [Class-imbalance handling] Class-weighted loss plus stratified 80/10/10 splits so rare categories (e.g. health) are learned, not ignored.
  • [Live classification demo] Paste any Marathi headline; the demo returns the predicted category with a full probability distribution.
  • [Per-class evaluation] Macro-F1 plus per-class precision/recall, so the report shows exactly which categories confuse the model.
  • [Error analysis] Confusion matrix and misclassified-headline review included in the notebook for viva discussion.
  • [Exported model] Saved weights with a one-line inference function for the demo and any downstream use.

What is included

  • Complete fine-tuning and evaluation Jupyter notebook
  • Trained IndicBERT classification model with inference code
  • Live Marathi headline classification web demo
  • Per-class metrics, confusion matrix and error-analysis plots
  • Project report PDF (background, transformer theory, methodology, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (BERT, fine-tuning, tokenization, F1, imbalance)

Limitations & prerequisites

  • 89.4% macro-F1 is a design target for the fine-tuning run, stated honestly — the report documents the measured figure after training.
  • The demo covers 6 headline categories; the full 12-class LDC label set is trained and evaluated in the notebook.
  • Very short or ambiguous headlines (2–3 words) classify less reliably.
  • Code-mixed Marathi-English headlines are handled only as far as the training data covers them.
  • The model reflects the news domain — it is not a general Marathi text classifier.

Frequently Asked Questions

Why IndicBERT instead of mBERT?

IndicBERT is pretrained specifically on 12 Indian languages with far more Marathi text than mBERT saw, so it tokenizes Devanagari more efficiently and fine-tunes to higher accuracy on Marathi tasks.

Which dataset is used?

L3Cube MahaNews — a Marathi news corpus from L3Cube, Pune, with topic labels. The long-document-classification split has 12 topic classes; the demo showcases 6 headline categories.

Does it need transliteration?

No. The pipeline works directly on Devanagari script with IndicNLP tokenization, which preserves Marathi morphology that transliteration would destroy.

How is class imbalance handled?

Rare categories get higher weight in the loss function, and the split is stratified so every class appears in train, validation and test. Per-class F1 in the report shows the honest picture.

Which categories confuse the model most?

Politics vs business on budget/policy news, and health (the smallest class) against everything — the confusion matrix in the report documents this for the viva.

Is this project suitable for a final-year project?

Yes — for Computer Science, IT and AI/ML programs. It demonstrates transfer learning on a low-resource Indian language with rigorous evaluation and a working demo. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.

Components & software requirements
  • Python 3, PyTorch
  • Hugging Face Transformers
  • IndicBERT (AI4Bharat)
  • IndicNLP tokenizer
  • scikit-learn (metrics)
  • HTML/CSS/JS demo
  • L3Cube MahaNews corpus

Dataset & model details

  • Dataset: L3Cube MahaNews — Marathi news headlines and articles with topic labels, released by L3Cube (Pune); the long-document-classification (LDC) split carries 12 topic classes.
  • Task: Text classification; input = Marathi headline/article text in Devanagari, output = probability distribution over topic categories (6 demo classes, 12 full).
  • Model: IndicBERT (ALBERT-based, pretrained on 12 Indian languages by AI4Bharat, IIT Madras) fine-tuned with a linear classification head; class-weighted cross-entropy.
  • Metrics: Macro-F1 design target 89.4%, accuracy design target 91.2% on the MahaNews test split; per-class F1 reported (lowest: health, 0.78 design target). No metric is claimed as measured until the fine-tuning run is executed for the order.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation