Skip to main content
QUICK REVIEW

[Paper Review] System and Methods for Converting Speech to SQL

S. Sachin Kumar, Ashish Kumar|arXiv (Cornell University)|Aug 14, 2013
Advanced Database Systems and QueriesComputer Science4 references5 citations
TL;DR

This paper presents a domain-independent system that converts spoken English queries into executable SQL queries using speech-to-text conversion via HTK and Julius, followed by rule-based natural language to SQL translation employing lexical analysis, parsing, and syntax-directed translation with JFLex and BYACC. The key contribution is a modular, database-agnostic framework that enables end-to-end speech-to-SQL conversion without requiring domain-specific training data.

ABSTRACT

This paper concerns with the conversion of a Spoken English Language Query into SQL for retrieving data from RDBMS. A User submits a query as speech signal through the user interface and gets the result of the query in the text format. We have developed the acoustic and language models using which a speech utterance can be converted into English text query and thus natural language processing techniques can be applied on this English text query to generate an equivalent SQL query. For conversion of speech into English text HTK and Julius tools have been used and for conversion of English text query into SQL query we have implemented a System which uses rule based translation to translate English Language Query into SQL Query. The translation uses lexical analyzer, parser and syntax directed translation techniques like in compilers. JFLex and BYACC tools have been used to build lexical analyzer and parser respectively. System is domain independent i.e. system can run on different database as it generates lex files from the underlying database.

Motivation & Objective

  • To enable end-to-end conversion of spoken English queries into executable SQL for relational databases.
  • To address the challenge of translating natural language speech into structured SQL without requiring domain-specific language models.
  • To develop a system that is independent of the underlying database schema by dynamically generating lex files from the schema.
  • To leverage compiler construction techniques—lexical analysis, parsing, and syntax-directed translation—for robust and accurate SQL generation from natural language input.

Proposed method

  • Speech input is processed using HTK and Julius to convert audio into text, leveraging acoustic and language models.
  • The resulting English text query is parsed using a custom parser built with BYACC, which supports context-free grammar rules for natural language structures.
  • A lexical analyzer generated via JFLex identifies tokens such as keywords, column names, and operators from the text query.
  • The system applies rule-based translation rules to map natural language constructs to equivalent SQL syntax, including WHERE, JOIN, and aggregate clauses.
  • The system dynamically generates lex files from the schema of the target RDBMS, enabling domain independence.
  • Syntax-directed translation techniques are used to build a semantic tree that maps linguistic structures to corresponding SQL syntax.

Experimental results

Research questions

  • RQ1How can spoken English queries be accurately transcribed into text using off-the-shelf speech recognition tools?
  • RQ2What rule-based approach enables reliable mapping of natural language phrases to structured SQL syntax?
  • RQ3Can a system be designed to be independent of specific database schemas through dynamic schema-aware lexicon generation?
  • RQ4To what extent do compiler-style techniques (lexical analysis, parsing, translation) improve the accuracy of speech-to-SQL translation?

Key findings

  • The system successfully converts spoken English queries into executable SQL queries using only rule-based methods and compiler construction tools.
  • The use of JFLex and BYACC enables efficient and maintainable implementation of the lexical and syntactic analysis pipeline.
  • The system is fully domain-independent, as it generates lex files from the database schema at runtime, allowing deployment across different RDBMS instances.
  • The integration of HTK and Julius for speech-to-text conversion achieves sufficient accuracy for natural language processing tasks in the target domain.
  • The rule-based translation pipeline demonstrates robustness across diverse query types, including selection, filtering, and aggregation, without requiring annotated training data.

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.