Inspiration

Everyday consumers, freelancers, and small businesses routinely sign SaaS agreements, loan contracts, and service terms without legal counsel—losing thousands of dollars to hidden predatory clauses such as silent auto-renewals, non-refundable deposit locks, exorbitant liquidated damages, compounding high-APR fees, and unilateral data resale rights. At the same time, pasting confidential contracts into cloud LLM tools exposes sensitive financial and personal data to third-party servers.

We built VeriClaim Deep-NLP for the Silicon Valley Buildathon to deliver a 100% local, zero-data-leakage neural contract auditor that detects hidden financial traps in milliseconds, visually explains why specific words are dangerous, rewrites predatory clauses into fair mutual terms, and mathematically verifies risk reduction before the user signs.

What it does

VeriClaim Deep-NLP executes an end-to-end Closed-Loop Neural Auditing Pipeline completely locally:

  • Deep Transformer Clause Analysis (9.28 ms/clause): Evaluates every contract clause using a fine-tuned 66M-parameter DistilBERT sequence classifier trained on predatory vs. fair legal and financial terms (100.0% validation accuracy, 1.0000 ROC-AUC).
  • Explainable AI (XAI) Token Risk Heatmap: Visually highlights exact predatory legal triggers (non-refundable, automatically, liquidated damages, irrevocable, 39.9% APR) in crimson and amber so users immediately understand why a clause poses financial risk.
  • Closed-Loop Neural Hardening & Interactive Plotly Analytics: Automatically rewrites flagged clauses into balanced, consumer-safe mutual terms, re-runs the hardened contract through DistilBERT, and plots an interactive Plotly comparison bar chart—mathematically proving that peak risk drops from 99.7% down to 1.3% (-98.4% reduction).
  • Real Document Workflow & Financial Exposure Math: Supports direct .pdf and .txt file uploads, computes prevented hidden annual loss ($ exposure & effective APR), tracks live session telemetry (gr.State), and exports a downloadable VeriClaim_DeepNLP_Audit_Report.txt.

How we built it — Engineering Iteration (v1.0 Baseline ➔ v2.0 Fine-Tuned DistilBERT)

A core goal of our build was rigorous testing and iteration:

  1. v1.0 Baseline (Simple Keyword Match): Our initial prototype relied on basic keyword matching (78.4% validation accuracy). During live testing on a multi-trap SaaS contract, v1.0 caught only a single obvious "penalty" clause (62.0% risk) while completely missing silent auto-renewal and third-party data-resale traps.
  2. v2.0 Fine-Tuned DistilBERT Engine: To solve multi-clause semantic detection, we fine-tuned a 66M-parameter distilbert-base-uncased model on CUDA (7.2s training time, 9.28 ms inference latency per clause), then integrated an XAI token risk heatmap, symbolic contract hardening, interactive Plotly risk-reduction charts, and PDF/TXT file ingestion inside a Gradio web interface.

Challenges we ran into

  • Capturing Subtle Predatory Phrasing: Simple rules failed on clauses that hid financial traps behind formal legal language; fine-tuning a contextual Transformer (DistilBERT) resolved multi-clause ambiguity with 1.0000 ROC-AUC.
  • Proving That Rewrites Are Actually Safe: Rather than blindly trusting generated edits, we engineered a closed-loop verification step that re-scores every hardened clause with the neural classifier and visualizes the exact risk drop on a live chart.

Accomplishments that we're proud of

  • Built a 100% local, privacy-preserving neural auditing system that processes full multi-clause contracts in under 60 ms without sending a single byte to external cloud APIs.
  • Demonstrated measurable iterative improvement (v1.0 single-trap detection vs. v2.0 full multi-trap neutralization from 99.7% to 1.3% risk) alongside downloadable audit reports.

Disclosed Reused Tools & Team Contribution

  • Reused Open-Source Tools & Pretrained Assets: Built using Hugging Face's pretrained distilbert-base-uncased weights, PyTorch, Transformers, Scikit-Learn, Plotly, pypdf, and Gradio.
  • Team Contribution: Built solo during the hackathon—covering dataset curation, DistilBERT fine-tuning, XAI token heatmap rendering, symbolic contract hardening, Plotly visualization, and end-to-end testing.

What's next for VeriClaim Deep-NLP

  • Add OCR support for scanned physical contracts and multi-language legal auditing.
  • Package VeriClaim Deep-NLP as a lightweight browser extension to automatically audit Terms of Service and SaaS checkout agreements before users click "I Agree."

Built With

Share this project:

Updates

Submission history