How shresthasingh1501/legal_document_analysis works
Project type and purpose
• This is a specialized NLP pipeline (“Legal Document Analysis”) that takes PDF documents as input, extracts text (with OCR fallback), preprocesses it, and then runs two parallel ML workflows: summarization (Flan-T5) and named-entity recognition (BERT). There is also an optional Streamlit UI for interactive use.
File structure
• Top-level:
• code/analysis.py – core pipeline orchestration (PDF→text→preprocessing→inference)
• code/bert-ocr.py – text extraction + OCR for scanned docs
• streamlit-ui.py – optional front-end service layer
• notebooks/… – Jupyter notebooks for model fine-tuning (training flow, not part of runtime)
• samplepdfs/ – directory for test PDF inputs
• requirements.txt – dependency list (PyTorch, Hugging Face Transformers, Tesseract-OCR, Streamlit)