Skip to content

adithyanum/legal_document_simplifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ Legal Document Simplifier

An interactive web application that simplifies complex legal documents like contracts, policies, and acts using a transformer-based abstractive summarization model from Hugging Face. Built using Streamlit, this tool enables users to upload .txt, .pdf, or .docx files and get readable, condensed summaries instantly.


🎯 Objective

Legal language is often long, repetitive, and hard to interpret. This app automates the summarization of such documents, helping:

  • πŸ“š Law students & educators
  • πŸ§‘β€βš–οΈ Legal professionals
  • 🧠 General users needing simplified legal content

πŸš€ Features

  • πŸ“‚ Upload legal documents in .txt, .pdf, or .docx
  • πŸ” Automatic chunking for long texts
  • πŸ€– BART-based summarization (facebook/bart-large-cnn)
  • πŸŽ› Select between Concise and Detailed summaries
  • πŸ“₯ Download the final summary as a .txt file
  • 🧾 PDF and DOCX parsing support

πŸ› οΈ Tech Stack

Tool Purpose
Streamlit Frontend interface
Hugging Face Transformers Abstractive summarization
NLTK Sentence tokenization
PyMuPDF PDF text extraction
python-docx DOCX text extraction

πŸ€– Model Used

  • Model: facebook/bart-large-cnn
  • Type: Abstractive summarization
  • Token Limit: Up to 1024 tokens per chunk
  • Trained On: CNN/DailyMail dataset

πŸ§ͺ Results

The app was tested on various legal documents including the Indian Patents Act, 1970.

  • Original Length: ~14,000 words
  • Final Summary: ~300–500 words
  • Performance:
    • βœ… Preserved key definitions and clauses
    • βœ… Reduced redundant legal text
    • βœ… Made procedural language easier to interpret

Example:
β€œPatent means a patent for any invention granted under this Act...”
⟢ Retained due to legal significance and accuracy


🧾 Sample Output

πŸ“„ Click to View Full Summary PDF

About

A Streamlit web app that simplifies complex legal documents using Hugging Face BART summarization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published