Skip to content

ai-tonchev/bg-parliament-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bulgarian Parliament Dashboard

A semantic search and topic exploration dashboard for Bulgarian parliamentary speeches, built with Dash and designed for stateless deployment on Fly.io.

Features

  • 🔍 Semantic Search: Search 370k+ parliamentary speeches using AI-powered multilingual embeddings
  • 📊 Interactive Topic Explorer: Explore topics with UMAP visualization, temporal distribution, and representative speeches
  • ⚡ Fast: Pre-computed embeddings in LanceDB for instant search
  • 🐳 Git LFS: Large data files tracked with Git LFS for simple deployment

Prerequisites


Quick Start

1. Clone & Setup

git clone <repo-url>
cd bg-parliament-dashboard

# Ensure LFS files are pulled
git lfs pull

2. Preprocessing (First Time Only)

Run this locally with your GPU to generate the data files:

# Install GPU dependencies
pip install -r requirements-gpu.txt

# Configure Kaggle credentials
mkdir -p ~/.kaggle
echo '{"username": "YOUR_USERNAME", "key": "YOUR_KEY"}' > ~/.kaggle/kaggle.json
chmod 600 ~/.kaggle/kaggle.json

# Run preprocessing
python preprocess.py

This creates:

  • parliament_data/ - LanceDB vector database (~500MB)
  • model_cache/ - Sentence-transformers model (~1.3GB)
  • assets/topic_data.json - Topic data with 2D embeddings

3. Commit Data to Git LFS

# Track large files with LFS
git lfs track "parliament_data/**"
git lfs track "model_cache/**/*.bin"
git lfs track "model_cache/**/*.safetensors"
git lfs track "assets/topic_data.json"

# Commit everything
git add .
git commit -m "Add preprocessed data via LFS"
git push

4. Local Development

pip install -r requirements.txt
python app.py

Open http://localhost:8050


Fly.io Deployment

1. Install Fly CLI

curl -L https://fly.io/install.sh | sh
fly auth login

2. Launch & Deploy

fly launch
# Follow prompts, select region close to Bulgaria (e.g., fra)

fly deploy

Note: Fly.io automatically pulls Git LFS files during build.


Tech Stack

Component Technology
Frontend Dash, Plotly, Bootstrap
Vector DB LanceDB (embedded)
Embeddings intfloat/multilingual-e5-large
Topic Modeling BERTopic
Server Gunicorn

Data Sources

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages