A spoken natural-language question is converted end-to-end into a SQL query, executed against a real database, and answered back as speech.
🎤 Voice → ASR (Whisper) → Intent Check → Text-to-SQL (SQLCoder-7B)
→ SQL Validation + SQLite Execution → Response Generation → TTS → 🔊
Dataset: SpokenSpider — 100 Spider-benchmark questions × 4 conditions (clean, 20dB, 10dB, 0dB SNR), synthesized with gTTS.
This submission ships code, notebooks, and results — not the raw audio dataset or Spider databases (840MB+), which are regenerable. data/metadata.csv contains the full evaluation results (400 rows: transcripts, generated SQL, execution results, latencies) backing every figure and table in notebooks/analysis.ipynb. The notebooks already contain their executed outputs, so all results, figures, and tables can be viewed without re-running anything.
-
Install dependencies
pip install -r requirements.txt -
Download Spider benchmark (questions, SQL, and SQLite databases)
python data/download_spider.pyIf automatic database download fails (Google Drive often rate-limits), download the Spider zip manually from the Spider website or Kaggle, then run:
python data/download_spider.py --from-zip path/to/spider.zip -
Generate the SpokenSpider audio dataset (100 questions × 4 SNR conditions)
python src/dataset_gen.py --max-samples 100This populates
data/spoken_spider/{clean,noisy_0db,noisy_10db,noisy_20db}/and writes the base rows ofdata/metadata.csv. -
Run the full pipeline batch evaluation
python src/pipeline.py --batch --snr-filter clean 0db 10db 20db --no-speakThis fills in the pipeline result columns (
p_transcript,p_generated_sql,p_exec_*, latencies, etc.) indata/metadata.csv. -
Open the notebooks
jupyter notebook notebooks/analysis.ipynb # full evaluation results & figures jupyter notebook notebooks/demo.ipynb # live single-query walkthrough + TTS comparisonIn Jupyter: Kernel → Restart & Run All.
src/ Pipeline modules (ASR, Text-to-SQL, DB execution, response gen, TTS)
evaluation/ Metrics (WER/EXA/VQA/SLA) and research-question experiments
demo/ Live microphone demo script
notebooks/ analysis.ipynb (full results) and demo.ipynb (live walkthrough)
data/ metadata.csv (evaluation results) + download/generation scripts
outputs/ Saved figures, LaTeX results table, demo audio samples
- ASR (Whisper) is robust up to 20 dB SNR (WER ≈ 0.017) but degrades sharply at 0 dB (WER ≈ 0.169).
- SQLCoder partially absorbs ASR noise — SQL execution accuracy drops only ~7pp from clean to 0dB despite a 10× WER increase.
simple_selectqueries are most noise-sensitive;aggregationqueries are the most robust.- SQLCoder dominates end-to-end latency (~96% of total, ~16s/query) — the bottleneck for real-time deployment.
- VITS (neural TTS) beats gTTS on both synthesis latency and naturalness, and runs fully offline.
- Noise mainly hurts through a rising "no-answer" rate (8% → 13% at 0dB) rather than wrong answers — the safer failure mode for a call-center deployment.