How aditya11-05/judgebert-lmp works
JUDGEBERT-LMP is a research prototype for legal-meaning-preservation scoring, with a Streamlit interface and FastAPI service. A user submits a sentence pair or CSV; the frontend validates and sends requests, while the backend returns a model score only when a trained model is available, plus rule-based findings and optional baseline scores. The repository also includes dataset preparation and human-annotation capabilities. The README documents planned/unavailable model capabilities; those are shown as such. Some dataset and annotation wiring is based on indexed references rather than inspected implementation excerpts.
Main entry points: streamlit_app.py Streamlit app · service.py Analysis service · engine.py Legal findings · batch.py CSV batch
Components 25
User interfaces
- Streamlit app
frontend/streamlit_app.py - CSV batch
frontend/batch.py - HTTP client
frontend/api_client.py - Result presenters
frontend/presenters.py - Annotation interface
frontend/annotation.py
Analysis API
- HTTP routes
app/routes.py - Analysis service
app/service.py - Runtime settings
app/config.py
Findings and scoring
- Legal findings
app/explanations/engine.py - English features
app/explanations/lexicon_en.py - Change rules
app/explanations/rules.py - Text alignment
app/explanations/alignment.py - Score categories
app/scoring.py - Explanation dataset
app/explanations/dataset.py
Models and baselines
- Model inference
app/inference.py - XLM-R regressor
app/models/xlmr.py - Baseline registry
app/baseline_service.py - Baseline models
app/models/baselines.py - Model evaluation
app/models/evaluate.py
Research data
- Dataset loading
app/data/load_dataset.py - Dataset validation
app/data/validate_dataset.py - Group-aware splitting
app/data/split_dataset.py - Annotation storage
app/data/annotation_store.py
Other components
- Research user
- FastAPI service
Connections 22
- Research user → Streamlit app: uses
- Streamlit app → HTTP client: requests through
frontend/streamlit_app.py - Streamlit app → CSV batch: runs
frontend/streamlit_app.py - Streamlit app → Result presenters: displays with
frontend/streamlit_app.py - Streamlit app → Annotation interface: offers
frontend/streamlit_app.py - CSV batch → HTTP client: submits batches
frontend/batch.py - CSV batch → Result presenters: formats results
frontend/batch.py - HTTP client → FastAPI service: sends HTTP
frontend/api_client.py - FastAPI service → HTTP routes: serves routes
- HTTP routes → Analysis service: dispatches to
app/routes.py - Analysis service → Model inference: requests scores
app/service.py - Analysis service → Legal findings: generates findings
app/service.py - Analysis service → Score categories: categorizes scores
app/service.py - Analysis service → Baseline registry: requests baselines
app/service.py - Model inference → XLM-R regressor: loads and runs
app/inference.py - Baseline registry → Baseline models: loads and scores
app/baseline_service.py - Legal findings → English features: extracts features
app/explanations/engine.py - Legal findings → Change rules: applies rules
app/explanations/engine.py - Legal findings → Text alignment: marks spans
app/explanations/engine.py - Dataset loading → Dataset validation: validates data
app/data/load_dataset.py - Dataset validation → Explanation dataset: checks explanation schema
app/data/validate_dataset.py - Annotation interface → Annotation storage: records annotations
frontend/annotation.py