How pranavv-07/nlp-to-sql-generator works
Restaurant Intelligence is an offline Flask application for asking plain-English questions of a restaurant SQLite database. The main workflow runs through the Flask app, which orchestrates tokenisation, POS tagging, lemmatisation, entity and intent recognition, schema mapping, SQL generation, validation, and execution; results can then be displayed as tables, KPI cards, or charts. The README also documents a dashboard and visual NLP pipeline, while the tree includes history and database pages. UI wiring and those page behaviors are only partly evidenced by the supplied excerpts, so those links are documented at a high level.
Main entry points: app.py Flask app · restaurant.db Restaurant database · app.js Browser interactions · database.py SQLite access
Components 16
Web experience
- Flask app
app.py - Web pages
templates - Browser interactions
static/js/app.js - Charts
static/js/charts.js
Language pipeline
- Tokeniser
nlp/tokenizer.py - POS tagger
nlp/pos_tagger.py - Lemmatizer
nlp/lemmatizer.py - Entity recogniser
nlp/entity_recognizer.py - Intent classifier
nlp/intent.py - Schema mapping
nlp/schema_mapper.py
Query processing
- SQL generator
nlp/sql_generator.py - SQL validator
nlp/validator.py
Restaurant data
- SQLite access
database.py - Restaurant database
restaurant.db - Demo data seeder
seed_database.py
Other components
- Restaurant user
Connections 16
- Restaurant user → Web pages: opens pages
README.md - Restaurant user → Flask app: asks query
README.md - Flask app → Tokeniser: tokenises
app.py - Flask app → POS tagger: tags tokens
app.py - Flask app → Lemmatizer: lemmatises
README.md - Flask app → Entity recogniser: recognises entities
README.md - Flask app → Intent classifier: classifies intent
README.md - Flask app → Schema mapping: maps schema
app.py - Flask app → SQL generator: generates SQL
app.py - Flask app → SQL validator: validates SQL
app.py - Flask app → SQLite access: executes query
app.py - SQLite access → Restaurant database: reads and writes
database.py - Demo data seeder → Restaurant database: seeds data
seed_database.py - Flask app → Browser interactions: returns results
README.md - Browser interactions → Charts: renders charts
README.md - Flask app → Restaurant database: queries dashboard
app.py