CoolFace
Apppublic

npc0/TorontoOpenDataQA

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
README.md85 linesDownload Raw Back to root
1---2title: TorontoOpenDataQA3emoji: ๐Ÿ™๏ธ4colorFrom: blue5colorTo: purple6sdk: gradio7sdk_version: 5.49.18app_file: app.py9pinned: false10license: mit11short_description: AI search City's Open Data to answer question about Toronto12header: mini13---14 15# Toronto Open Data QA [WIP, contribution needed]16 17AI-powered question answering system for Toronto's open datasets.18 19## Features20 21- ๐Ÿ” **Smart Search**: Searches through 500+ Toronto open datasets22- ๐Ÿค– **AI Analysis**: Uses Claude to understand your question and select relevant data23- ๐Ÿ“Š **SQL Generation**: Automatically generates and executes SQL queries24- โœ… **Full Transparency**: Shows all steps, queries, and results for verification25- ๐Ÿ“ **Natural Language**: Get answers in clear, easy-to-understand format26 27## How to Use28 291. Get a free API key from [Anthropic Console](https://console.anthropic.com/)302. Enter your question about Toronto data313. Paste your API key324. Click "Ask"33 34The system will:35- Search the Toronto Open Data index36- Select the most relevant datasets37- Download and convert the data38- Generate SQL queries to answer your question39- Provide a comprehensive answer with sources40 41## Example Questions42 43- "What are the top 5 most dangerous intersections in Toronto?"44- "How has parking ticket revenue changed over the years?"45- "Which neighborhoods have the most tree coverage?"46- "What are the most common types of 311 service requests?"47 48## Privacy49 50- Your API key is used only for the current session51- No data is stored or logged52- All processing happens in real-time53- Query results are shown for full transparency54 55## Technical Details56 57**Stack:**58- Gradio for UI59- DuckDB for SQL queries60- Anthropic Claude for AI61- Docling for file conversion62 63**Data Source:**64[Toronto Open Data Index](https://github.com/NewJerseyStyle/Open-Toronto-Data-Index)65 66## Verification67 68All answers include:69- Links to source datasets70- SQL queries used71- Number of rows analyzed72- Steps to manually verify results73 74## Limitations75 76- Depends on Docling API availability (may have rate limits)77- Not all file formats are supported78- Data is as current as the Toronto Open Data portal79 80## Contribution81Known issues on the download and import dataset from open data portal to duckdb not stable, conversion fails a lot, needs further inspection and debugging.82 83## License84 85MIT License