LoRA-Fine-Tuned Commercial Lease Clause Risk Classifier
Llama 3.1 8B fine-tuned with LoRA/QLoRA on a curated corpus of EU-jurisdiction commercial lease agreements. Classifies 23 clause types, flags 11 risk patterns against standard templates, and outputs a structured JSON risk report with per-clause remediation notes. A 60-page lease is processed in under 10 seconds.
Discuss a Similar ProjectWhat We Built
Training Dataset Curation
4,000 EU-jurisdiction commercial lease agreements de-identified and annotated with clause type labels and risk pattern tags — forming the fine-tuning corpus for the model.
LoRA/QLoRA Fine-Tuning
Llama 3.1 8B adapted via LoRA/QLoRA on a single A10G GPU — learning 23 clause type labels and 11 risk pattern classes specific to EU commercial lease language and structure.
Structured JSON Risk Output
Every clause extracted with: type classification, risk level (LOW / MEDIUM / HIGH), a plain-language deviation summary, and a specific remediation note suggesting the corrected clause wording.
Baseline Comparison Engine
Delta analysis between each extracted clause and the client's own standard template — highlighting deviations, missing protections, and non-standard additions in a structured diff view.
FastAPI Serving with PDF Preprocessing
REST API endpoint accepts uploaded PDFs and Word documents. pdfplumber with OCR fallback handles scanned and image-based leases — the model ingests clean text regardless of source format.
Colour-Coded Report Export
Word and PDF reports generated automatically — each clause highlighted green, amber, or red by risk level, with remediation notes inserted as tracked changes for direct solicitor review.
Technologies Used
Key Outcomes
Clause classification accuracy across all 23 clause types
Processing time per 60-page commercial lease document
Junior associate review time saved per contract
Need Something Similar?
Tell us about your document type, jurisdiction, and labelling requirements. We will recommend the best fine-tuning approach and give you an honest assessment.