CoolFace
Apppublic

npc0/TorontoOpenDataQA

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

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

  1. 1.Get a free API key from Anthropic Console
  2. 2.Enter your question about Toronto data
  3. 3.Paste your API key
  4. 4.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