An app for searching through Danish statutes.
-
Install the correct Python version:
pyenv install
-
Install the dependencies:
pdm use python pdm install
Install Playwright's dependencies (Chrome, Firefox, Webkit, and FFmpeg):
pdm run playwright install pdm run playwright install-deps
-
Install the pre-commit hooks:
pdm run pre-commit install
-
Scrape a specific statute from retsinformation.dk:
pdm run scrape-statute \ --url https://www.retsinformation.dk/eli/lta/2023/1180 \ --output-path data/eli-lta-2023-1180.html \ --force
-
Parse downloaded statute:
pdm run parse-statute \ --input-path data/eli-lta-2023-1180.html \ --output-path data/eli-lta-2023-1180.json \ --force
-
Build Llama index using Cohere Embed API:
pdm run build-index-cohere \ --statute-path data/eli-lta-2023-1180.json \ --index-dir data/llama-indices/cohere-embed-v3 \ --cohere-api-key $COHERE_API_KEY -
Run web app for searching through the statute for parental leave:
pdm run ui-parental-leave