Skip to main content
QUICK REVIEW

[Paper Review] Speech-to-SQL: Towards Speech-driven SQL Query Generation From Natural Language Question

Yuanfeng Song, Raymond Chi-Wing Wong|arXiv (Cornell University)|Jan 4, 2022
Speech and dialogue systemsComputer Science7 citations
TL;DR

This paper introduces Speech-to-SQL, a novel end-to-end task that directly translates natural language speech into structured SQL queries, bypassing the error-prone cascaded ASR+text-to-SQL pipeline. The proposed SpeechSQLNet model leverages speech signals directly, achieving higher accuracy than cascaded methods and state-of-the-art text-to-SQL models on the newly constructed SpeechQL dataset, demonstrating the feasibility and superiority of speech-driven database querying.

ABSTRACT

Speech-based inputs have been gaining significant momentum with the popularity of smartphones and tablets in our daily lives, since voice is the most easiest and efficient way for human-computer interaction. This paper works towards designing more effective speech-based interfaces to query the structured data in relational databases. We first identify a new task named Speech-to-SQL, which aims to understand the information conveyed by human speech and directly translate it into structured query language (SQL) statements. A naive solution to this problem can work in a cascaded manner, that is, an automatic speech recognition (ASR) component followed by a text-to-SQL component. However, it requires a high-quality ASR system and also suffers from the error compounding problem between the two components, resulting in limited performance. To handle these challenges, we further propose a novel end-to-end neural architecture named SpeechSQLNet to directly translate human speech into SQL queries without an external ASR step. SpeechSQLNet has the advantage of making full use of the rich linguistic information presented in speech. To the best of our knowledge, this is the first attempt to directly synthesize SQL based on arbitrary natural language questions, rather than a natural language-based version of SQL or its variants with a limited SQL grammar. To validate the effectiveness of the proposed problem and model, we further construct a dataset named SpeechQL, by piggybacking the widely-used text-to-SQL datasets. Extensive experimental evaluations on this dataset show that SpeechSQLNet can directly synthesize high-quality SQL queries from human speech, outperforming various competitive counterparts as well as the cascaded methods in terms of exact match accuracies.

Motivation & Objective

  • To address the limitations of cascaded ASR + text-to-SQL pipelines, which suffer from error compounding and require high-quality ASR.
  • To enable direct, end-to-end translation of spoken natural language questions into executable SQL queries, lowering the barrier for non-technical users.
  • To explore speech-driven interfaces that bypass text, especially benefiting low-resource languages lacking written forms.
  • To construct a new benchmark dataset, SpeechQL, by extending existing text-to-SQL datasets with speech transcripts to support end-to-end training and evaluation.
  • To validate the effectiveness of end-to-end speech-to-SQL models in generating accurate SQL from arbitrary spoken questions.

Proposed method

  • Propose SpeechSQLNet, an end-to-end neural architecture that directly maps raw speech signals to SQL queries without relying on intermediate ASR transcripts.
  • Utilize speech representations (e.g., MFCCs) as input, preserving rich linguistic and prosodic information lost in text transcription.
  • Design a sequence-to-sequence model with attention mechanisms to map speech embeddings to structured SQL syntax.
  • Train the model jointly on the newly constructed SpeechQL dataset, which extends popular text-to-SQL benchmarks with speech-utterance paired data.
  • Adopt a hybrid training strategy combining speech features and sequence modeling to improve robustness to ASR-like errors.
  • Compare SpeechSQLNet against cascaded baselines (ASR + text-to-SQL) and state-of-the-art text-to-SQL models to evaluate end-to-end performance.

Experimental results

Research questions

  • RQ1Can end-to-end speech-to-SQL models outperform cascaded ASR + text-to-SQL pipelines in SQL generation accuracy?
  • RQ2To what extent does direct speech-to-SQL modeling preserve linguistic and prosodic cues that improve generalization compared to text-based models?
  • RQ3How robust are end-to-end models to ASR errors when the input is already transcribed, and can they generalize to low-resource languages?
  • RQ4Can a speech-driven interface significantly reduce the time and cognitive load for non-technical users to query relational databases?
  • RQ5Does leveraging raw speech signals lead to better generalization than relying on ASR transcripts, especially in low-resource language settings?

Key findings

  • SpeechSQLNet achieves higher exact match accuracy than cascaded ASR + text-to-SQL methods, demonstrating the superiority of end-to-end learning for speech-to-SQL.
  • The model outperforms state-of-the-art text-to-SQL models even when the latter are fine-tuned on the same SpeechQL dataset, indicating the advantage of direct speech input.
  • A 33% ASR error rate causes over 36% accuracy drop in downstream text-to-SQL models, highlighting the vulnerability of cascaded systems.
  • The proposed SpeechQL dataset enables reliable evaluation of end-to-end speech-to-SQL models and supports future research in speech-driven database querying.
  • Speech-to-SQL is shown to be a viable and effective paradigm, especially for non-technical users and low-resource language communities.
  • The results validate that speech signals contain extra-linguistic information beneficial for SQL generation, which is lost in transcription.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.