← Back to Projects

Law Exam Batch Processor

Enterprise‑grade, self‑hosted system for generating strict, exam‑oriented Indian law answers, performing domain‑prioritized fact‑checking, and exporting verified PDFs.


1. Overview

Law Exam Batch Processor is a production‑ready Flask application designed for Indian law students, researchers, and legal professionals who require:

The system combines:


2. Architecture

Backend

Frontend


3. Key Features


4. Answer Policy (Exam Mode)

Each answer strictly follows:

  1. Meaning / Direct Answer
  2. Statutory Provision
  3. Essential Points (brief explanation only)
  4. Case Law (ONE most relevant case)
  5. Conclusion
  6. Confidence Level

Explicitly excluded:


5. Fact‑Checking Strategy


6. Directory Structure

project-root/
│
├── app.py              # Flask backend
├── templates/
│   └── index.html      # Frontend UI
├── md/                 # Per‑question markdown
├── output/
│   ├── *_final.md
│   └── *_final.pdf
└── README.md

7. Requirements

System

Dependencies


8. Installation

1. Clone Repository

git clone <your-repo-url>
cd law-exam-batch-processor

2. Python Environment

python3 -m venv venv
source venv/bin/activate
pip install flask requests ollama

3. Install System Tools

sudo apt install pandoc wkhtmltopdf

4. Setup Ollama

ollama pull gemma3:4b

5. Setup SearXNG


9. Running the Application

python app.py

Access UI at:

http://localhost:5000

10. API Endpoints

Endpoint Method Purpose
/exam POST Submit batch questions
/progress/ GET Poll progress
/download/pdf/ GET Download final PDF

11. Security & Privacy


12. Intended Use

Not intended for:


13. License

This project is released under a permissive open‑source license.

You are free to:

Attribution is appreciated.


14. Credits & Acknowledgements

This project builds upon and credits the following open‑source software and platforms:

All trademarks and copyrights belong to their respective owners.


15. Disclaimer

This software is provided for educational and research purposes.

While best efforts are made to ensure legal accuracy, users must independently verify answers before reliance in professional or judicial contexts.


16. Maintainer

Maintained by an independent legal‑tech developer.

Contributions, audits, and improvements are welcome via pull requests.



Back to Projects