MCPcopy Index your code
hub / github.com/Isha-Das-06/Policy_Outcome_Predictor

github.com/Isha-Das-06/Policy_Outcome_Predictor @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8 symbols 24 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Multi-Modal Policy Success & Impact Prediction

📌 Overview

This project implements a Multi-Modal, Multi-Output Deep Learning Model designed to predict the success probability and impact score of government or organizational policies. By leveraging both the policy's written text and relevant socio-economic data, the model provides a comprehensive prediction.

The system also includes a Flask-based Web Application for user interaction, allowing policymakers and researchers to test policy inputs and receive real-time predictions through a simple interface.


⚙️ Methodology

  1. Text Processing
  2. Model: BERT (bert-base-uncased)
  3. Converts policy text into a 768-dim embedding → reduced to 128-dim.

  4. Numeric Feature Processing

  5. Model: Multi-Layer Perceptron (MLP)
  6. Input: 6 numeric features.
  7. Architecture: Linear(6→64) → ReLU → Linear(64→32).
  8. Output: 32-dim numeric embedding.

  9. Fusion Layer

  10. Concatenates text embedding (128-dim) + numeric embedding (32-dim).
  11. Produces a shared 64-dim representation.

  12. Outputs

  13. Success Probability → Linear(64→1) + Sigmoid (0.0–1.0)
  14. Impact Score → Linear(64→1) (-1.0–+1.0)

  15. Explainability

  16. LIME Tabular → Explains numeric features.
  17. LIME Text → Highlights influential words in text.

📊 Features

Feature Description Range Example
Policy Text The written policy statement Any text "Increase renewable energy subsidies"
Population Country population 1k – 1.4B 170,000,000 (Bangladesh)
GDP per capita (USD) Average income per person 500 – 80,000 4,000 (middle income)
Education Index Education level index 0.2 – 0.95 0.85 (high)
Past Policy Success Rate Fraction of past policies successful 0.0 – 1.0 0.75
Past Impact Score Average effect of past policies -1.0 – +1.0 +0.7
AvgSentiment Public/media sentiment towards the policy -1.0 – +1.0 +0.8

🚀 How It Works

  1. User inputs policy text + numeric features via Flask UI.
  2. Model processes each modality separately (BERT for text, MLP for numeric).
  3. A fusion layer merges embeddings.
  4. Outputs:
  5. Success Probability (0–1)
  6. Impact Score (-1 to +1)

🖥️ Web Application (Flask UI)

The project includes a Flask web app for real-time predictions.
The interface allows users to input data and visualize model outputs.

📷 Place your Flask app screenshot at:
Jupyter


🛠️ Tech Stack

  • Python 3.9+
  • Flask
  • PyTorch
  • Hugging Face Transformers (BERT)
  • scikit-learn
  • LIME (Explainability)
  • Pandas / NumPy

📂 Project Structure

├── data/               # Input datasets
├── models/             # Model architecture & training scripts
├── notebooks/          # Jupyter notebooks for experiments
├── utils/              # Preprocessing & helper functions
├── static/images/      # Web app static assets (UI screenshot here)
├── app.py              # Flask app entry point
├── templates/          # HTML templates for Flask
├── Report.docx         # Project documentation
└── README.md           # Project overview

📖 Example Input/Output

Input Example (JSON):

{
  "policy_text": "Increase renewable energy subsidies to reduce carbon emissions.",
  "population": 170000000,
  "gdp_per_capita": 4000,
  "education_index": 0.65,
  "past_success_rate": 0.45,
  "past_impact_score": 0.3,
  "avg_sentiment": 0.7
}

Output Example (JSON):

{
  "success_probability": 0.78,
  "impact_score": 0.52
}

📌 Future Improvements

  • Integration with SHAP for more robust interpretability.
  • Expanding features with additional socio-economic indicators.
  • Deploying as a REST API for real-time evaluation.

👨‍💻 Authors

  • Isha Das — 📧 isha@idtechsolutionsbd.com
  • Md Jisan Ahmed — 📧 jisan3325@gmail.com

Core symbols most depended-on inside this repo

predict_with_lime
called by 1
app.py
numeric_predict
called by 0
app.py
text_predict
called by 0
app.py
index
called by 0
app.py
forward
called by 0
model_def.py

Shape

Function 4
Method 2
Class 1
Route 1

Languages

Python100%

Modules by API surface

app.py5 symbols
model_def.py3 symbols

For agents

$ claude mcp add Policy_Outcome_Predictor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact