Salmane Chafik
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Research Subjects
Salmane Chafik has a total of 4 co-authors. Here are the top co-authors by number of shared publications:
- Saad Ezzini
King Fahd University of Petroleum and Minerals, Dhahran, Saudi Arabia
4 shared publications - Ismail Berrada
College of Computing, Mohammed VI Polytechnic University, Ben Guerir, Morocco
2 shared publications Ismail Berrada
Mohammed VI Polytechnic University
1 shared publication- Ismail Berrada
Mohammed VI Polytechnic University
1 shared publication
Latest Publications
- Open Access
- 11 March 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (4) , 1-27
Towards Automating Domain-Specific Data Generation for Text-to-SQL: A Comprehensive Approach
As software systems increasingly rely on natural language interfaces, ensuring the reliability of these systems is crucial. One critical component is the ability to accurately translate natural language queries into corresponding SQL queries, a field known as Text-to-SQL. However, the scarcity of high-quality, large-scale, and domain-specific Text-to-SQL datasets hinders the development of reliable and robust models. To tackle these challenges, we propose SelectCraft , a novel automatic generation approach designed to create realistic Text-to-SQL datasets tailored to specific domains. Our method leverages existing databases and their structures to generate complex text-SQL pairs that mirror real-world usage scenarios. As a proof of concept, we have successfully generated a substantial financial Text-to-SQL dataset, denominated as BanQies , encompassing over 1 million samples utilizing our proposed approach. Moreover, we introduce BanQL , a new large language model (LLM) based on StarCoder2 , a state-of-the-art code-based LLM, and fine-tuned on our newly created dataset. We evaluate BanQL performance against several state-of-the-art models, demonstrating significant enhancements in accuracy and generalizability, highlighting the advantages of incorporating domain-specific data in Text-to-SQL tasks. We firmly believe that our contributions have the potential to improve the overall reliability of Text-to-SQL software systems. CCS Concepts: • Software and its engineering; • Computing methodologies → Natural languageprocessing; • Information systems → Structured Query Language;
- 11 March 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (4) , 1-27
Open AccessTowards Automating Domain-Specific Data Generation for Text-to-SQL: A Comprehensive Approach
As software systems increasingly rely on natural language interfaces, ensuring the reliability of these systems is crucial. One critical component is the ability to accurately translate natural language queries into corresponding SQL queries, a field known as Text-to-SQL. However, the scarcity of high-quality, large-scale, and domain-specific Text-to-SQL datasets hinders the development of reliable and robust models. To tackle these challenges, we propose SelectCraft , a novel automatic generation approach designed to create realistic Text-to-SQL datasets tailored to specific domains. Our method leverages existing databases and their structures to generate complex text-SQL pairs that mirror real-world usage scenarios. As a proof of concept, we have successfully generated a substantial financial Text-to-SQL dataset, denominated as BanQies , encompassing over 1 million samples utilizing our proposed approach. Moreover, we introduce BanQL , a new large language model (LLM) based on StarCoder2 , a state-of-the-art code-based LLM, and fine-tuned on our newly created dataset. We evaluate BanQL performance against several state-of-the-art models, demonstrating significant enhancements in accuracy and generalizability, highlighting the advantages of incorporating domain-specific data in Text-to-SQL tasks. We firmly believe that our contributions have the potential to improve the overall reliability of Text-to-SQL software systems. CCS Concepts: • Software and its engineering; • Computing methodologies → Natural languageprocessing; • Information systems → Structured Query Language;
- Open Access
- 12 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Asian and Low-Resource Language Information Processing
- Vol. 25 (2) , 1-19
DarijaDB: Unlocking Text-to-SQL for Arabic Dialects
Recent advances in text-to-SQL models, which translate natural language questions (NLQs) into executable SQL queries, have made interacting with relational databases more accessible, even for those with limited technical ability. This task has seen significant improvement with the release of multiple English datasets and benchmarks such as WikiSQL, SPIDER, and BIRD, each covering different domains and levels of complexity. Non-English high-resource languages, such as Chinese, Russian, and Arabic, have also benefited from these advances, either through the translation of existing datasets or the creation of new ones. Dialect2SQL , a newly released text-to-SQL dataset, is dedicated to the Moroccan dialect (Darija), which is known for its complexity and distinctiveness compared to other Arabic dialects and Modern Standard Arabic. In this article, we conduct a comprehensive study on text-to-SQL for Darija by conducting several experiments mainly on the Dialect2SQL dataset using different approaches and configurations with two code-based large language models, StarCoder2 and Qwen-2.5-Coder. The experiments reveal the performance gap between models fine-tuned on English data and those fine-tuned on Darija. Additionally, the results illustrate the positive impact of incorporating multi-language datasets during training. In particular, the gap decreases from 10.1% to 6.7% in BLEU, and from 12.5% to 5.7% in TSED.
- 12 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Asian and Low-Resource Language Information Processing
- Vol. 25 (2) , 1-19
Open AccessDarijaDB: Unlocking Text-to-SQL for Arabic Dialects
Recent advances in text-to-SQL models, which translate natural language questions (NLQs) into executable SQL queries, have made interacting with relational databases more accessible, even for those with limited technical ability. This task has seen significant improvement with the release of multiple English datasets and benchmarks such as WikiSQL, SPIDER, and BIRD, each covering different domains and levels of complexity. Non-English high-resource languages, such as Chinese, Russian, and Arabic, have also benefited from these advances, either through the translation of existing datasets or the creation of new ones. Dialect2SQL , a newly released text-to-SQL dataset, is dedicated to the Moroccan dialect (Darija), which is known for its complexity and distinctiveness compared to other Arabic dialects and Modern Standard Arabic. In this article, we conduct a comprehensive study on text-to-SQL for Darija by conducting several experiments mainly on the Dialect2SQL dataset using different approaches and configurations with two code-based large language models, StarCoder2 and Qwen-2.5-Coder. The experiments reveal the performance gap between models fine-tuned on English data and those fine-tuned on Darija. Additionally, the results illustrate the positive impact of incorporating multi-language datasets during training. In particular, the gap decreases from 10.1% to 6.7% in BLEU, and from 12.5% to 5.7% in TSED.
- Open Access
- 15 August 2025
- Published by Cambridge University Press (CUP) in Natural Language Processing
- Vol. 31 (6) , 1399-1422
Enhancing security in text-to-SQL systems: A novel dataset and agent-based framework
This paper explores the significant advancements in generating Structured Query Language (SQL) from natural language, primarily driven by Large Language Models (LLMs). These advancements have led to the development of sophisticated text-to-SQL integrated applications, enabling easier database (DB) querying for users unfamiliar with SQL syntax using natural language queries. However, reliance on LLMs exposes these applications to potential attacks through the introduction of malicious prompts or by compromising models with malicious data during the training phase. Such attacks pose severe risks, including unauthorized data access or even complete DB destruction upon success. To address these concerns, we introduce a novel large-scale dataset comprising malicious and safe prompts along with their corresponding SQL queries, enabling model fine-tuning on malicious query detection tasks. Moreover, we propose the implementation of two transformer-based classification solutions to aid in the detection of malicious attacks. Finally, we present a secure agent-based text-to-SQL architecture that incorporates these solutions to enhance overall system security, resulting in a 70% security enhancement overall compared to solely relying on a conventional text-to-SQL model.
- 15 August 2025
- Published by Cambridge University Press (CUP) in Natural Language Processing
- Vol. 31 (6) , 1399-1422
Open AccessEnhancing security in text-to-SQL systems: A novel dataset and agent-based framework
This paper explores the significant advancements in generating Structured Query Language (SQL) from natural language, primarily driven by Large Language Models (LLMs). These advancements have led to the development of sophisticated text-to-SQL integrated applications, enabling easier database (DB) querying for users unfamiliar with SQL syntax using natural language queries. However, reliance on LLMs exposes these applications to potential attacks through the introduction of malicious prompts or by compromising models with malicious data during the training phase. Such attacks pose severe risks, including unauthorized data access or even complete DB destruction upon success. To address these concerns, we introduce a novel large-scale dataset comprising malicious and safe prompts along with their corresponding SQL queries, enabling model fine-tuning on malicious query detection tasks. Moreover, we propose the implementation of two transformer-based classification solutions to aid in the detection of malicious attacks. Finally, we present a secure agent-based text-to-SQL architecture that incorporates these solutions to enhance overall system security, resulting in a 70% security enhancement overall compared to solely relying on a conventional text-to-SQL model.
- Open Access
Dialect2SQL: A Novel Text-to-SQL Dataset for Arabic Dialects with a Focus on Moroccan Darija
The task of converting natural language questions (NLQs) 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 languages, 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.
Open AccessDialect2SQL: A Novel Text-to-SQL Dataset for Arabic Dialects with a Focus on Moroccan Darija
The task of converting natural language questions (NLQs) 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 languages, 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.