D ialect2 SQL : A Novel Text-to- SQL Dataset for A rabic Dialects with a Focus on M oroccan D arija (2025)

Abstract: The task of converting natural language questions into executable SQL queries, known as text-to-SQL, has gained significant interest in recent years, as it enables non-technical users to interact with relational databases. Many benchmarks, such as SPIDER and WikiSQL, have contributed to the development of new models and the evaluation of their performance. In addition, other datasets, like SEDE and BIRD, have introduced more challenges and complexities to better map real-world scenarios. However, these datasets primarily focus on high-resource languages such as English and Chinese. In this work, we introduce Dialect2SQL, the first large-scale, cross-domain text-to-SQL dataset in an Arabic dialect. It consists of 9,428 NLQ-SQL pairs across 69 databases in various domains. Along with SQL-related challenges such as long schemas, dirty values, and complex queries, our dataset also incorporates the complexities of the Moroccan dialect, which is known for its diverse source lan-guages, numerous borrowed words, and unique expressions. This demonstrates that our dataset will be a valuable contribution to both the text-to-SQL community and the development of resources for low-resource languages.

## related work in recent years, there has been significant progress in the field of text-to-sql. various studies @xcite focused on improving the accuracy and efficiency of converting natural language questions into sql queries, and others focused on addressing the critical needs of datasets and benchmarks. zhong et al. @xcite introduced the first large-scale cross-domain text-to-sql dataset wikisql, composed of 80,654 examples dis-tributed across 24,241 tables from wikipedia in different domains. however this dataset was judged of simplicity, each question concerns only one simple table. to address this problem, 11 students from yale university manually annotated a text-to-sql dataset named spider @xcite . this dataset comes with more complex queries joining multiple tables and spanning different domains and databases. however, both datasets were judged non-realistic because of the way they were created, simple database schemas, and simple questions. to address this issue, hazoom et al. @xcite introduced sede, a text-to-sql dataset dedicated solely for training and evaluation, composed of 12,023 nlq-sql pairs collected from real usage on the stack exchange website, including a variety of real-world challenges rarely reflected in previous works. in the same context, li et al. @xcite constructed another benchmark named bird containing 12,751 pairs, 95 databases, and spanning over 37 professional domains. this benchmark comes with more challenges to immitate real-world situation by providing long sequence schemas, one database may include up to 60 tables, and dirty values. while these studies focused on english datasets, other works have explored datasets in additional languages. for example, dou et al. @xcite manually translated the spider dataset into multiple languages, including english, german, french, spanish, japanese, chinese, and vietnamese. they conducted various experiments using multilingual models in each language to assess the impact of training large language models on the same dataset across different languages simultaneously. additionally, they introduced a framework called save (schema augmentation with verification) to help close the performance gap between models trained on the english dataset and those trained on other languages. on the other hand, bakshandaeva et al. @xcite introduced pauq, the first russian text-to-sql dataset, which they developed based on the spider dataset. they trained two baseline models, rat-sql @xcite and @xcite , on pauq to assess the trade-offs between using automatically translated and manually crafted natural language questions. their analysis highlights the strengths and limitations of each approach, offering insights into how translation quality affects model performance in multilingual text-to-sql tasks. similarly, almohaimeed et al. @xcite introduced an arabic version of the spider dataset, naming it ar-spider. to explore the linguistic challenges specific to arabic, the authors fine-tuned two base models, lgesql @xcite and s2sql @xcite , using two different multilingual encoders: mbert @xcite and xlm-r @xcite . additionally, they proposed a context similarity relationship (csr) approach, which led to a significant increase in overall performance, helping to close the gap between arabic and english language models. other datasets have been created from scratch to support cross-database context-dependent textto-sql (xdts) tasks. for instance, the chase dataset @xcite includes 17,940 questions in chinese designed specifically for xdts. chase enables models to handle complex, multiturn questions across different databases, facilitating research into both cross-database adaptability and contextual dependency in query generation. likewise, the sesql dataset @xcite comprises 27,012 question-sql pairs, also in chinese. sesql further enriches the resources available for training and evaluating models on xdts tasks by providing a wide array of question types and database contexts. motivated by these works, our paper introduces a large-scale, cross-domain text-to-sql dataset in the moroccan dialect, based on the well-known bird dataset @xcite . ## approach this section explains the choice of dataset, the translation process, and presents key statistics for dialect2sql. ## conclusion & future work in this paper, we introduce a novel large-scale, cross-domain text-to-sql dataset in the moroccan dialect (darija), named dialect2sql. this dataset is manually translated from the english version of bird, which is known for its complexity, variety, and the new challenges it introduces in mapping real-world scenarios. to ensure the quality of the dataset, we first perform an initial automatic translation using gpt-4, followed by manual editing of the automatically translated questions by three computer science students who are native speakers of darija and proficient in sql. this two-step process, automatic translation followed by detailed manual revision, ensures both linguistic accuracy and alignment with the technical requirements of sql, thereby enhancing the quality and usability of the dataset.