aarushi211/Summarization-of-TOS
This is a legal AI system that generates executive summaries and clause-grounded answers from long TOS documents. It is optimized for CPU-only deployement
What's novel
This is a legal AI system that generates executive summaries and clause-grounded answers from long TOS documents. It is optimized for CPU-only deployement
Code Analysis
15 files read · 4 roundsA RAG-based legal document analysis system that ingests Terms of Service PDFs, performs structure-aware chunking, hybrid retrieval (dense + BM25 with RRF fusion), cross-encoder reranking, and grounded Q&A with legal safety guards, served via a FastAPI backend with SSE streaming and a Next.js fronten
Strengths
Genuinely production-oriented engineering: structured JSON logging with request correlation, SSRF-safe URL validation, streaming error boundaries that prevent client hangs, dual-mode (desktop/server) vector store abstraction, and a thoughtful two-stage extract-then-synthesize QA pipeline with legal safety regexes and abstention logic. The evaluation suite (faithfulness LLM-as-judge with NLI fallback, adversarial red-team testing) shows real depth beyond a typical RAG demo.
Weaknesses
The core RAG pipeline (hybrid retrieval + reranking + grounded QA) is a well-executed but standard pattern — the novelty lies in the legal-domain-specific touches (structure-aware chunking for legal headers, query expansion synonyms, safety guards) rather than algorithmic innovation. The engine.py file at 34KB is a monolith that could benefit from further decomposition, and the two-stage QA prompt engineering, while thoughtful, is brittle to model changes.
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
137
Contributors
3
Files
133
Active weeks
10
Repository
Language
Python
Stars
3
Forks
0
License
—