|
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
|
| Volume 187 - Issue 114 |
| Published: June 2026 |
| Authors: Ritesh Kumar |
10.5120/ijcaff3006d1ef8e
|
Ritesh Kumar . text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate Representation. International Journal of Computer Applications. 187, 114 (June 2026), 54-62. DOI=10.5120/ijcaff3006d1ef8e
@article{ 10.5120/ijcaff3006d1ef8e,
author = { Ritesh Kumar },
title = { text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate Representation },
journal = { International Journal of Computer Applications },
year = { 2026 },
volume = { 187 },
number = { 114 },
pages = { 54-62 },
doi = { 10.5120/ijcaff3006d1ef8e },
publisher = { Foundation of Computer Science (FCS), NY, USA }
}
%0 Journal Article
%D 2026
%A Ritesh Kumar
%T text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate Representation%T
%J International Journal of Computer Applications
%V 187
%N 114
%P 54-62
%R 10.5120/ijcaff3006d1ef8e
%I Foundation of Computer Science (FCS), NY, USA
Natural language interfaces to databases have traditionally suffered from three structural limitations: exclusive targeting of relational SQL, unconditional dependence on large language model (LLM) inference at query time, and absence of any runtime signal when generated queries are semantically incorrect. This paper presents text2ql, an open-source Python framework that addresses all three limitations through a language-agnostic Intermediate Representation (QueryIR) and a pluggable renderer architecture. A single seven-stage detection pipeline serves both SQL and GraphQL targets; a zero-LLM deterministic mode delivers 100% execution accuracy at a median latency of 3.2 ms with no API cost; and every generated query carries a runtime confidence score in [0.15, 0.97] computed from an additive signal model. Evaluated on 50-query random samples from the Spider and BIRD benchmarks (indicative results; full-set evaluation is planned), the LLM-backed mode achieves 62–70% exact match and 84–91% execution accuracy; the deterministic mode achieves 100% execution accuracy with zero parse errors across all 100 test cases. An ablation study isolates schema-aware prompting as the dominant accuracy lever, contributing +18.4 percentage points of exact-match gain over the schema-free baseline on both benchmarks. text2ql is publicly available at pypi.org/project/text2ql under the Apache 2.0 license.