CivitasX | AI-Powered Policy Impact Simulator

Making public policies understandable, accessible, and transparent for everyone.

CivitasX is an AI-powered civic technology platform that transforms complex policy documents into clear, multilingual, and structured insights. It helps citizens, students, journalists, and other stakeholders understand proposed policies, explore their potential impacts, and evaluate their benefits and risks before implementation.

By combining document processing, generative AI, multilingual translation, and interactive visualization, CivitasX bridges the gap between complicated legislative language and accessible public understanding.


💡 Inspiration

Public policies shape almost every aspect of our daily lives, from taxation and healthcare to education, employment, and environmental protection.

However, policy proposals are often written in lengthy, technical, and legally complex language that makes them difficult for ordinary citizens to understand.

We built CivitasX to bridge this transparency gap.

Our vision is to make policy analysis accessible to everyone, regardless of their language, educational background, or familiarity with legal terminology, empowering people to understand what a policy actually means and how it could affect society.


🚀 What It Does

CivitasX transforms policy drafts into comprehensive, easy-to-understand analyses through an intuitive AI-powered interface.

📄 Flexible Document Input

  • Paste policy text directly into the application.
  • Upload policy documents in PDF format.
  • Automatically extract text from digitally generated PDFs using pypdf.
  • Detect scanned or image-based PDFs and fall back to OCR using pytesseract and pdf2image.

🧠 AI-Powered Policy Analysis

Powered by the Google Gemini API, CivitasX generates a structured analysis containing:

  • Plain-Language Summary: Explains the policy in understandable language, with the level of detail adjusted according to document length.
  • Potential Benefits: Identifies intended advantages and positive outcomes.
  • Risks & Drawbacks: Highlights possible negative consequences, limitations, and unintended effects.
  • Environmental Impact: Evaluates potential environmental implications.
  • Impact Scoring: Assigns scores from 0 to 100 across four dimensions:
    • Economic Impact
    • Social Equity
    • Environmental Impact
    • Public Sentiment

🌍 Multilingual Accessibility

CivitasX supports analysis output in 10 languages:

English, Urdu, Hindi, Arabic, French, Spanish, Chinese, Turkish, Bengali, and Pashto.

Features include:

  • Multilingual analysis and translation.
  • Right-to-left (RTL) formatting for Urdu, Arabic, and Pashto.
  • Language-aware text presentation.
  • Audio playback of generated analysis through text-to-speech.

🔊 Audio Accessibility

Users can listen to policy analysis instead of relying entirely on text.

CivitasX integrates Google Text-to-Speech (gTTS) to generate audio narration, making policy insights more accessible to users who prefer audio or face reading-related accessibility barriers.

📊 Interactive Visualization & Export

  • Interactive Plotly charts for comparing policy impact scores.
  • Visual representation of the four impact dimensions.
  • Downloadable analysis reports in text format.

🛠️ How We Built It

CivitasX combines document processing, generative AI, visualization, and accessibility technologies into a single application.

Component Technology Purpose
Frontend Streamlit Interactive web interface
AI Engine Google Gemini API Policy analysis and structured insights
AI SDK google-genai Integration with Gemini
PDF Processing pypdf Extract text from digital PDFs
OCR pytesseract Recognize text in scanned documents
PDF Rendering pdf2image Convert PDF pages into images for OCR
Visualization Plotly Interactive impact score charts
Text-to-Speech gTTS Multilingual audio narration
Language Processing AI-powered translation Multilingual analysis output
Deployment Streamlit Community Cloud Cloud hosting

Application Architecture

The application follows a modular processing pipeline:

  1. Input: Users provide policy text or upload a PDF.
  2. Extraction: The system extracts document text using PDF parsing or OCR fallback.
  3. Analysis: The extracted text is sent to the Gemini API for structured policy evaluation.
  4. Scoring: The AI generates impact scores across four dimensions.
  5. Localization: The analysis is translated and formatted for the selected language.
  6. Visualization: Results are displayed through structured sections and interactive charts.
  7. Accessibility: Users can listen to the analysis or download the generated report.

⚙️ Technical Implementation

Dynamic Analysis Depth

Policy documents vary significantly in length and complexity. CivitasX dynamically adjusts the depth of its generated summaries and analysis based on the size of the submitted document.

This allows shorter proposals to receive concise explanations while longer documents receive more detailed breakdowns.

PDF Processing & OCR Fallback

The document processing pipeline supports both digitally generated and scanned PDFs.

PDF Upload
    │
    ▼
Text Extraction using pypdf
    │
    ├── Text Available ──► Extracted Policy Text
    │
    └── No Readable Text
              │
              ▼
       PDF → Images (pdf2image)
              │
              ▼
          OCR (pytesseract)
              │
              ▼
       Extracted Policy Text
              │
              ▼
        Gemini AI Analysis

Four-Dimensional Impact Framework

Each policy is evaluated across four dimensions to provide a broader perspective on its potential consequences.

Dimension Focus
Economic Financial consequences, economic growth, costs, employment, and resource allocation
Social Equity Fairness, accessibility, distribution of benefits, and effects on different communities
Environmental Sustainability, ecological effects, emissions, and environmental consequences
Public Sentiment Potential public acceptance, concerns, reactions, and societal perception

Each dimension receives a score between 0 and 100, accompanied by AI-generated explanations.


🏆 Accomplishments We're Proud Of

  • Building an end-to-end AI-powered civic technology application, from document ingestion to policy analysis and accessibility.
  • Supporting both digital and scanned policy documents through integrated text extraction and OCR.
  • Making policy insights accessible across 10 languages, including regional languages such as Urdu and Pashto.
  • Implementing right-to-left text formatting for languages that require it.
  • Integrating audio narration to provide an alternative way to consume policy analysis.
  • Designing a four-dimensional impact scoring framework that makes complex policy trade-offs easier to explore.
  • Creating an intuitive interface that transforms lengthy policy documents into structured and actionable insights.

🧩 Challenges We Ran Into

1. Handling Digital and Scanned PDFs

Government and policy documents frequently contain scanned pages rather than selectable text.

Implementing a reliable fallback pipeline between pypdf, pytesseract, and pdf2image required handling different document formats, extraction failures, and cloud deployment dependencies.

We also needed to configure system-level packages such as Poppler and Tesseract for deployment environments.

2. Multilingual & Right-to-Left Formatting

Supporting English alongside languages such as Urdu, Arabic, and Pashto introduced challenges involving text alignment, readability, punctuation, and layout direction.

We worked to ensure RTL text remained readable and that translated content and audio playback worked within the same interface.

3. Scaling AI Output

Short policy proposals and lengthy legislative documents require different levels of explanation.

We developed prompt logic to adjust the analysis depth proportionally to document length while maintaining consistent output sections and readable formatting.

4. Deployment Dependencies

Deploying an application that requires Python packages and external system binaries introduced additional configuration requirements.

We configured requirements.txt and packages.txt to support the deployment environment on Streamlit Community Cloud.


📚 What We Learned

  • Integrating traditional document processing techniques with generative AI to handle real-world documents.
  • Designing multilingual applications with proper RTL support.
  • Building AI pipelines that generate structured and consistent outputs.
  • Using prompt engineering to adapt analytical depth to varying input lengths.
  • Designing accessibility features such as audio narration alongside visual interfaces.
  • Managing Python and system-level dependencies for cloud deployment.
  • Turning a socially meaningful problem into a practical, interactive AI application.

🔮 What's Next?

We envision expanding CivitasX into a more comprehensive platform for civic understanding and policy transparency.

📑 Side-by-Side Policy Comparison

Allow users to compare multiple policy drafts or competing proposals to understand how amendments change potential economic, social, and environmental outcomes.

🔍 Citation & Clause Highlighting

Connect generated insights directly to the relevant paragraphs, clauses, or pages of the original document, helping users verify AI-generated analysis.

📄 Advanced Report Export

Introduce professionally formatted PDF and DOCX reports suitable for classrooms, journalists, researchers, and community organizations.

🗣️ Expanded Language & Voice Support

Improve regional language coverage and introduce richer voice options to make policy analysis accessible to more communities.

🏛️ Civic Education Integration

Explore tools designed specifically for students, educators, journalists, and civic organizations to encourage informed public participation.


⚠️ Responsible AI & Limitations

CivitasX is designed to support policy understanding, not replace legal expertise, policymakers, or independent research.

  • AI-generated analysis may contain inaccuracies or omit important context.
  • Impact scores are analytical estimates, not objective measurements of policy outcomes.
  • Public sentiment scores do not represent actual surveys or public opinion data unless supported by external evidence.
  • Policy outcomes depend on implementation, economic conditions, institutional factors, and other variables.
  • Users should verify important conclusions against the original policy document and reliable sources.

CivitasX should be used as an informational and exploratory tool.


🎯 Our Vision

We believe understanding public policy should not require a law degree, advanced education, or fluency in technical language.

CivitasX aims to make policy information more transparent, accessible, and inclusive by bringing AI-powered analysis into the hands of everyday people.

Understand policies. Explore their impacts. Make informed decisions.


Built with ❤️ for a more informed and inclusive society.

Built With

Share this project:

Updates

Submission history