Psukhe777/LexRisk
The AI Safety Gauge for Legal Contracts. ⚖️ Scans PDFs, detects predatory clauses, and scores risk using Llama-3 & Cosine Similarity.
What's novel
The AI Safety Gauge for Legal Contracts. ⚖️ Scans PDFs, detects predatory clauses, and scores risk using Llama-3 & Cosine Similarity.
Code Analysis
7 files read · 3 roundsA Streamlit-based contract risk analysis tool that uses NLP semantic pre-filtering (100-clause predatory pattern library with sentence-transformer embeddings) to reduce LLM API calls, then routes high-risk chunks to Groq/OpenAI for legal analysis with jurisdiction-specific rule overlays (Federal/Cal
Strengths
The NLP pre-filtering engine with a curated 100-clause predatory pattern library and cosine similarity matching is a genuinely useful optimization that reduces LLM costs. The jurisdictional rules engine with real legal citations (CCPA, GDPR, TCPA, FTC) and the deterministic liability calculator show real domain knowledge and non-trivial implementation depth.
Weaknesses
The flat file structure with 47 top-level modules and no package organization makes the codebase hard to navigate and maintain. The redliner's fuzzy matching uses O(n*m) sliding window with SequenceMatcher which will be extremely slow on large contracts, and the overall architecture lacks proper error recovery for LLM JSON parsing failures.
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
66
Contributors
1
Files
21
Active weeks
3
Repository
Language
Python
Stars
1
Forks
0
License
MIT