Bhargav Adepu

NO. 16MACHINE LEARNING · SHIPPEDAPRIL – MAY 2025

Legal Document Analysis

Hybrid NLP over Indian Supreme Court judgments

SummarizationBART-large-cnn
ClassificationLegal-BERTnlpaueb, legal corpus
EntitiesBERT NERdslim/bert-base-NER
TopicsLDAclustering by theme

Python · Flask · Transformers · BART · Legal-BERT · LDA · TF-IDF

The system runs two analysis paths over the same document. The rule-based path extracts and cleans PDF text, then pattern-matches legal entities — judges, parties, statutes, sections and case citations — along with dates and metadata, keyword extraction and simple extractive summarisation. It is fast, deterministic and needs no GPU.

The ML path layers on three specific models: facebook/bart-large-cnn for abstractive summarisation, nlpaueb/legal-bert-base-uncased for document classification, and dslim/bert-base-NER for entity recognition, with LDA topic modelling for clustering documents by theme. The two paths are toggleable independently, so the tool degrades to something usable rather than failing when the models are unavailable.