Skip to content

vikwritescode/derivative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Derivative: An Open Source BP Debate Tracker

Currently live on derivative.lol. This is the back-end of a tracker designed for British Parliamentary debating, allowing users record and import results, view their history, and access summary statistics. The front-end is visible here

Built with Python, FastAPI, Pydantic, pandas, Uvicorn, scikit-learn, and Firebase. All code is made available under the GNU AGPLv3 license.

Features

  • Add debate results
  • Import from TabbyCat URLs
  • Track performance over time
  • View and manage history
  • User registration and authentication
  • Automatic motion categorisation

Planned

  • Improved motion categorisation model
  • Docker support for easier deployment

Setup Instructions

  1. Clone and enter the repository:
git clone https://github.com/vikwritescode/bp-debate-tracker
cd bp-debate-tracker
  1. Initialise a Python virtual environment:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Configure Firebase

    • head to Firebase console
    • create a new project, enable Authentication
    • under project settings, go to the service accounts tab
    • generate a new private key and rename it to ServiceAccountKey.json
    • place it in the /src folder
    • add the path to ServiceAccountKey in your .env:
    echo "SERVICE_ACCT_KEY='./serviceAccountKey.json'" > .env
  2. Train classifier

    • a set of motions and their associated categories are required
    • modify the file in ai/train_model.py to extract this data accordingly
    • run train_model.py
    • this should generate three files in /src: classifier.pkl, multilabel_binarizer.pkl, and transformer.pkl
  3. Enter /src and run api.py :

cd src
python3 api.py

About

An Open Source BP Debate Tracker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages