πŸ›οΈ Legal / Policy Text Summarizer NLP

An advanced Transformer-based NLP model that simplifies legal, governmental, and policy documents into three easy-to-understand summary formats:

πŸ”Ή 3-line summary

πŸ”Ή 1-paragraph summary

πŸ”Ή Bullet points (3–7 bullets)

This project includes the full ML pipeline: preprocessing, PDF extraction, dataset creation, training, evaluation, inference, FastAPI deployment, Gradio UI, tests, and a HuggingFace model card.

πŸš€ Features

βœ” Summarizes long policies, laws, govt documents
βœ” Output styles: 3line, paragraph, bullets
βœ” Full training/evaluation pipeline
βœ” Works with PDFs
βœ” Built on google/flan-t5-base
βœ” Apache 2.0 licensed
βœ” HuggingFace-ready metadata

πŸ“ Project Structure

legal-policy-summarizer-nlp/
β”œβ”€β”€ data/
β”œβ”€β”€ src/
β”œβ”€β”€ tests/
β”œβ”€β”€ app/
β”œβ”€β”€ notebooks/
β”œβ”€β”€ huggingface/
β”œβ”€β”€ model/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── requirements.txt

πŸ“¦ Installation

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

πŸ“„ Dataset Preprocessing

python -m src.dataset_preprocessing --input data/raw/dataset.csv --output data/processed/dataset_clean.jsonl

πŸ‹οΈ Training

python -m src.train

πŸ§ͺ Evaluation

python -m src.evaluate

πŸ€– Inference

from src.inference import summarize
print(summarize("policy text...", mode="paragraph"))

🌐 API (FastAPI)

uvicorn app.api:app --reload --port 8000

🎨 Gradio UI

python app/ui.py
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for hmnshudhmn24/legal-policy-summarizer-nlp

Finetuned
(859)
this model