Badil System is an intelligent web-based platform designed to enhance criminal justice procedures by leveraging Natural Language Processing (NLP) for automated, transparent, and fair handling of crime-related complaints and the recommendation of correctional alternatives. The system enables citizens to submit complaints, automates crime type classification, and recommends suitable non-custodial measures—streamlining case processing for judicial and executive authorities.
-
Centralized Complaint Portal: Citizens can submit detailed narratives about crimes or violations.
-
Automated Crime Classification: NLP algorithms analyze complaint text to classify crime types.
-
Correctional Alternative Recommendations: Suggests rehabilitation-focused alternatives to imprisonment, tailored to the offense.
-
Role-Based Access & Workflow:
- Citizens: Register, submit complaints, track their cases.
- Judges: Review cases, approve or reject recommended alternatives, set ruling durations.
- Executive Authorities: Enforce approved alternatives, update status, manage implementation.
-
Case Tracking & Analytics: Real-time dashboard and statistics for all user roles.
-
User Authentication & Security: Robust login and access control for all users.
-
Modern, Responsive Interface: Built with HTML5, CSS3, Bootstrap, and AJAX for an interactive user experience.
The Badil System consists of three core layers:
- Frontend: Built using HTML5, CSS3, JavaScript, Bootstrap, and AJAX for responsive, real-time interfaces.
- Backend: Powered by PHP, interfacing with a MySQL database for user management, workflow logic, and data storage.
- NLP Engine: Implemented in Python, the NLP engine processes textual complaint data to classify crimes and recommend alternatives. It integrates with the backend via direct script calls or RESTful API.
Workflow Summary:
- Citizen submits complaint through the web portal.
- NLP engine analyzes complaint, classifies crime, and recommends correctional alternatives.
- Judge reviews the case and system recommendations, then approves/rejects the alternatives.
- Executive authority implements or logs the approved alternative, updating case status.
- Windows 10 (recommended; also works with Linux/macOS with LAMP stack)
- XAMPP (includes Apache, PHP, MySQL)
- Python 3.8+ (for NLP module)
- pip (Python package manager)
- Node.js/NPM (optional, for frontend asset management)
git clone https://github.com/sa1ah-ai/badil_system.git
cd badil_system- Install and run XAMPP.
- Use phpMyAdmin to create a MySQL database (e.g.,
badil_db). - Import the provided SQL schema (
/db/schema.sqlor equivalent). - Update database connection settings in
/backend/config.php. - Start Apache and MySQL services in XAMPP.
-
Navigate to the Python/NLP directory (e.g.,
/mlor/python). -
Install Python dependencies:
pip install -r requirements.txt
-
Run the training script or load the pre-trained model as described in
/ml/README.md. -
If the NLP service is provided via REST API, launch it and ensure the backend can reach the API.
- Serve the frontend files via Apache (
/frontendor/publicdirectory). - Ensure AJAX requests correctly target backend PHP endpoints.
- Register an account and log in.
- Submit a complaint by providing details about the crime/violation.
- Track the status of complaints and view recommended correctional alternatives.
- Log in through the judge portal.
- Access and review new cases and system recommendations.
- Approve or reject alternatives, set durations, and monitor statistics.
- Log in through the executive portal.
- View approved cases, implement correctional measures, and update case statuses.
- Frontend: HTML5, CSS3, JavaScript, Bootstrap, AJAX
- Backend: PHP 7+, MySQL
- Machine Learning/NLP: Python (scikit-learn, pandas, numpy, etc.)
- Environment: XAMPP (for local development), compatible with any LAMP stack
Below are sample screenshots showcasing key interfaces of the Badil System. All images are stored in the sys_screenshots folder. Thumbnails are displayed here for quick reference:
| Screenshot | File Name | Description |
|---|---|---|
| Login | login.png | User authentication page |
| Create Account | create_account.png | Registration form for new users |
| Profile | profile.png | User profile with personal/case statistics |
| Case Filing Questionnaire | case_filing_questionnaire.png | Initial complaint/case submission form |
| Upload Case Page | upload_case_page.png | Interface for filing/uploading a new case |
| Text of Crime Details | text_of_crime_detalis.png | Input for narrative details of the crime |
| Case Details | case_details.png | Case data and decision workflow |
| Crime Details (Judge View) | crime_details_Judge.png | In-depth view for judges, including decision/approval |
| Change Password | change_password.png | User password reset form |
For the complete user experience, see all files in the sys_screenshots folder. Images can be expanded for detail when viewed in your code hosting platform.
- NLP Model: Upgrade to advanced deep learning models or retrain with new datasets.
- Workflow: Add new user roles or process steps to fit evolving judicial or administrative needs.
- Analytics: Expand dashboards and reporting features for deeper insights.
- Localization: Adapt the interface and NLP processing for additional languages or jurisdictions.
- Optimized for Windows environments via XAMPP; for Linux/macOS, a standard LAMP setup is required.
- NLP accuracy is dependent on training data quality; for best results, use domain-specific datasets.
- Integration between backend and NLP engine may require configuration based on deployment context.
This project is provided for research and non-commercial use. For commercial or large-scale deployment, please contact the project maintainer.








