Broadening Access to Transportation Safety Data with Generative AI: A Schema-Grounded Framework for Spatial Natural Language Queries
Summary
A schema-grounded natural language interface for transportation safety analysis is presented, utilizing a large language model (LLM) to interpret user intent. This system translates user queries into structured semantic frames, which are then validated by a rule-based layer to correct errors (observed in 29% of evaluation queries) and ensure schema conformance. The validated frames are compiled into a typed directed acyclic graph (DAG) of spatial operations and executed against a PostGIS database, specifically a statewide Massachusetts transportation safety database. This database integrates crash records, roadway attributes, and geospatial layers like schools and bus stops. The framework successfully executed all 80 evaluation queries, demonstrating a practical approach to broadening access to complex safety data while maintaining reproducibility and auditability, crucial for public-sector planning. It supports both localized safety diagnosis and broader comparative screening.
Key takeaway
For public sector planners and AI engineers aiming to broaden access to complex geospatial safety data, this framework provides a robust model. You should implement a bounded design that separates LLM interpretation from deterministic execution, using a rule-based validation layer to ensure schema conformance and reproducibility. This approach mitigates hallucination and ensures auditable results, critical for institutional trust and supporting real planning decisions.
Key insights
A schema-grounded natural language interface broadens access to transportation safety data while ensuring reproducible, auditable analysis.
Principles
- Separate language interpretation from deterministic execution.
- Employ a rule-based validation layer for schema conformance.
- Design for reproducibility and auditability in public-sector AI.
Method
User queries are interpreted by an LLM into semantic frames, validated by a rule-based layer, compiled into a typed DAG of spatial operations, and executed against a PostGIS database.
In practice
- Query crash patterns near specific schools or bus stops.
- Rank towns or road segments by pedestrian crash frequency.
- Identify infrastructure deficiencies alongside crash exposure.
Topics
- Generative AI
- Transportation Safety
- Natural Language Interfaces
- Geospatial Analysis
- PostGIS
- LLM Validation
Best for: NLP Engineer, Research Scientist, AI Scientist, AI Engineer, Domain Expert
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.