npc0/TorontoOpenDataQA
0
Toronto Open Data QA [WIP, contribution needed]
AI-powered question answering system for Toronto's open datasets.
Features
- ๐ Smart Search: Searches through 500+ Toronto open datasets
- ๐ค AI Analysis: Uses Claude to understand your question and select relevant data
- ๐ SQL Generation: Automatically generates and executes SQL queries
- โ Full Transparency: Shows all steps, queries, and results for verification
- ๐ Natural Language: Get answers in clear, easy-to-understand format
How to Use
- Get a free API key from Anthropic Console
- Enter your question about Toronto data
- Paste your API key
- Click "Ask"
The system will:
- Search the Toronto Open Data index
- Select the most relevant datasets
- Download and convert the data
- Generate SQL queries to answer your question
- Provide a comprehensive answer with sources
Example Questions
- "What are the top 5 most dangerous intersections in Toronto?"
- "How has parking ticket revenue changed over the years?"
- "Which neighborhoods have the most tree coverage?"
- "What are the most common types of 311 service requests?"
Privacy
- Your API key is used only for the current session
- No data is stored or logged
- All processing happens in real-time
- Query results are shown for full transparency
Technical Details
Stack:
- Gradio for UI
- DuckDB for SQL queries
- Anthropic Claude for AI
- Docling for file conversion
Data Source: Toronto Open Data Index
Verification
All answers include:
- Links to source datasets
- SQL queries used
- Number of rows analyzed
- Steps to manually verify results
Limitations
- Depends on Docling API availability (may have rate limits)
- Not all file formats are supported
- Data is as current as the Toronto Open Data portal
Contribution
Known issues on the download and import dataset from open data portal to duckdb not stable, conversion fails a lot, needs further inspection and debugging.
License
MIT License
