Spaces:
Sleeping
Sleeping
Upload README.md
Browse files
README.md
CHANGED
|
@@ -9,3 +9,57 @@ python_version: "3.12"
|
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
| 12 |
+
|
| 13 |
+
# π‘οΈ ClauseGuard β AI Contract Analysis
|
| 14 |
+
|
| 15 |
+
**The world's most comprehensive open-source legal contract analysis tool.**
|
| 16 |
+
|
| 17 |
+
ClauseGuard automatically analyzes legal contracts using state-of-the-art NLP models fine-tuned on legal data.
|
| 18 |
+
|
| 19 |
+
## β¨ Features
|
| 20 |
+
|
| 21 |
+
### Core Analysis
|
| 22 |
+
- **41 CUAD Clause Categories** β Detects and classifies clauses across the full [CUAD](https://huggingface.co/datasets/theatticusproject/cuad-qa) taxonomy (Document Name, Parties, Governing Law, Indemnification, Termination, Non-Compete, IP Ownership, etc.)
|
| 23 |
+
- **4-Tier Risk Scoring** β Critical / High / Medium / Low with visual risk matrix
|
| 24 |
+
- **Legal NER** β Extracts parties, dates, monetary values, jurisdictions, defined terms
|
| 25 |
+
- **NLI Contradiction Detection** β Identifies conflicting clauses and missing critical provisions
|
| 26 |
+
- **PDF / DOCX / TXT Support** β Upload any contract format
|
| 27 |
+
|
| 28 |
+
### UI/UX
|
| 29 |
+
- **3-Panel Professional Layout** β Sidebar upload + Main analysis + Summary dashboard
|
| 30 |
+
- **Document Viewer** β Text with inline entity highlights
|
| 31 |
+
- **Clause Cards** β Expandable cards with risk badges and descriptions
|
| 32 |
+
- **Export Reports** β JSON (structured data) and CSV (tabular) downloads
|
| 33 |
+
- **Color-Coded Risk Badges** β Visual indicators for quick triage
|
| 34 |
+
|
| 35 |
+
## π§ Models Used
|
| 36 |
+
|
| 37 |
+
| Component | Model |
|
| 38 |
+
|-----------|-------|
|
| 39 |
+
| Clause Classification | `Mokshith31/legalbert-contract-clause-classification` (LoRA on `nlpaueb/legal-bert-base-uncased`) |
|
| 40 |
+
| Fallback Detection | Regex patterns covering 15+ clause types |
|
| 41 |
+
| NER | Rule-based with 7 entity types (dates, money, parties, jurisdictions, defined terms) |
|
| 42 |
+
| NLI | Heuristic contradiction detection across 5 conflict patterns |
|
| 43 |
+
|
| 44 |
+
## π Datasets
|
| 45 |
+
|
| 46 |
+
- [CUAD](https://huggingface.co/datasets/theatticusproject/cuad-qa) β 510 contracts, 13K annotations, 41 clause categories
|
| 47 |
+
- [LegalBench](https://huggingface.co/datasets/nguha/legalbench) β 322 legal reasoning tasks
|
| 48 |
+
- [LexGLUE](https://huggingface.co/datasets/coastalcph/lex_glue) β Unfair Terms of Service classification
|
| 49 |
+
|
| 50 |
+
## π Usage
|
| 51 |
+
|
| 52 |
+
1. Upload a contract (PDF, DOCX, or TXT) or paste text directly
|
| 53 |
+
2. Click **Analyze Contract**
|
| 54 |
+
3. View results across tabs: Document, Clauses, Entities, Contradictions
|
| 55 |
+
4. Download JSON/CSV reports
|
| 56 |
+
|
| 57 |
+
## β οΈ Disclaimer
|
| 58 |
+
|
| 59 |
+
*Not legal advice. ClauseGuard is an AI-powered analysis tool for informational purposes only. Always consult a qualified attorney for legal decisions.*
|
| 60 |
+
|
| 61 |
+
## π Links
|
| 62 |
+
|
| 63 |
+
- [Space](https://huggingface.co/spaces/gaurv007/ClauseGuard)
|
| 64 |
+
- [CUAD Paper](https://arxiv.org/abs/2103.06268)
|
| 65 |
+
- [LegalBench](https://huggingface.co/datasets/nguha/legalbench)
|