HybEx-Law: Hybrid Legal AI Engine

LegalBERT + GNN + Prolog hybrid reasoning system

A hybrid AI system integrating LegalBERT embeddings, GNN-based graph reasoning, and Prolog rule-based symbolic execution for legal aid eligibility determination.

HybEx-Law is a hybrid neural-symbolic AI system designed to automatically determine legal-aid eligibility under the Indian Legal Services Authorities Act. The project addresses a complex classification problem that requires both linguistic understanding and strict rule compliance. The system processes free-form queries written by citizens, extracts structured signals, interprets statutory thresholds, and produces eligibility decisions supplemented by confidence calibration and explicit reasoning tracebacks. HybEx-Law achieves state-of-the-art performance with an F1 of 0.985, confirming that hybrid architectures are superior to purely neural or purely symbolic models for high-stakes, rule-governed tasks.

Key metrics

  • Accuracy: 98.48%
  • Precision: 98.31%
  • Recall: 98.70%
  • F1-Score: 0.985

Tech stack

Python, PyTorch, LegalBERT, Graph Neural Networks, SWI-Prolog, Transformers, Sklearn (Calibration)

View on GitHub

← All projects