Publication: Büyük dil modeli desteği ile doğal dilden SQL dönüşümü yapan sistem oluşturulması
Abstract
Büyük dil modeli desteği ile doğal dilden SQL dönüşümü yapan sistem oluşturulması Son yıllarda, dünyada üretilen veri miktarı ve bu verilerin işlenmesi ihtiyacı baş döndürücü bir hızla artmaktadır. Kurumlar ve bireyler, büyük veri tabanlarında depolanan bilgilere daha hızlı ve etkili bir şekilde erişmek istemekte; bu da veri tabanı yönetimi ve sorgulama süreçlerini her zamankinden daha önemli hale getirmektedir. Ancak, karmaşık SQL sorguları yazabilmek, çoğu kullanıcı için ciddi bir teknik engel oluşturmaktadır. Bu nedenle, kullanıcıların doğal dil ile veri tabanlarına kolayca erişebilmesini sağlayacak akıllı sistemlere olan ihtiyaç her geçen gün artmaktadır. Bu çalışmada, doğal dilde ifade edilen soruları otomatik olarak SQL sorgularına dönüştüren bir sistemin tasarımı, model eğitimi ve uygulaması gerçekleştirilmiştir. Sistem, farklı araştırma grupları tarafından geliştirilmiş ve farklı mimari yaklaşımları temsil eden üç büyük dil modeli kullanılarak oluşturulmuştur. Bu amaçla, Google tarafından geliştirilen ve yaklaşık 220 milyon parametreye sahip ön eğitimli T5-Base, Facebook/ Meta tarafından geliştirilen 406 milyon parametreli ön eğitimli BART-Large ve Microsoft tarafından geliştirilen 400 milyon parametreli ön eğitimli ProphetNet modelleri kullanılmıştır. Bu modeller, Spider veri seti üzerinde özel olarak eğitilmiş; veri hazırlığı ve ince ayar süreçleri, bulut tabanlı cihazlar kullanılarak dikkatle yürütülmüştür. Geliştirilen uygulama sayesinde, kullanıcıların teknik bilgiye ihtiyaç duymadan veri tabanlarından sorgulama yapabilmesi amaçlanmıştır. Modellerin başarıları, Yürütme Doğruluğu (Execution Accuracy) ve BLEU Skor gibi ölçütlerle karşılaştırmalı olarak değerlendirilmiş ve hangi model mimarisinin Doğal Dil-Sql görevlerinde daha yüksek performans sunduğu ortaya konmuştur. Yapılan değerlendirmeler sonucunda, Bart-Large modeli, %45,00'lık bir Yürütme Doğruluğu (Execution Accuracy) ve %34,82'lik bir BLEU Skor elde ederek her iki metrikte de en yüksek başarıyı göstermiş ve tercih edilebilirlik açısından öne çıkmıştır. Onu, %35,00 Yürütme Doğruluğu (Execution Accuracy) ve %30,29 BLEU Skor ile T5-Base modeli takip etmiştir. İlginç bir bulgu olarak, ProphetNet modeli %34,00 ile T5-Base'e yakın bir yürütme doğruluğu sergilemesine rağmen, %4,25 gibi oldukça düşük bir BLEU skoru almıştır. Bu durum, ProphetNet'in anlamsal olarak doğru sonuçlar üretebilse de bunu referans sorgulardan sözdizimsel olarak oldukça farklı yapılarla başardığını göstermektedir. Çalışmanın sonunda hem model eğitimi hem de performans analizi açısından sistematik bir yapı ortaya konmuş; yapay zekanın veri tabanı sorgulamalarını daha erişilebilir kılmadaki gücü analiz edilmiştir. Elde edilen sonuçların, benzer çalışmalar yapacak araştırmacılar ve uygulayıcılar için önemli bir rehber niteliğinde olması hedeflenmiştir.
Creating a natural language to sql conversıon system with large language model support In recent years, the amount of data produced worldwide and the need to process this data have increased at a staggering rate. Organizations and individuals now require faster and more effective access to information stored in large databases, making database management and query processes more crucial than ever. However, writing complex SQL queries remains a significant technical barrier for most users. Consequently, there is a growing demand for intelligent systems that enable users to interact with databases easily through natural language. In this study, the design, training, and implementation of a system that automatically converts natural language queries into SQL statements are presented. The system leverages three large language models, each representing different architectural approaches and developed by leading research groups. For this purpose, the pretrained T5-Base model developed by Google (with approximately 220 million parameters), BART-Large by Facebook/ Meta (406 million parameters), and ProphetNet by Microsoft (400 million parameters) were utilized. These models were specifically fine-tuned on the Spider dataset, with data preparation and optimization processes meticulously carried out on high-performance cloud-based infrastructure. The developed application aims to allow users to query databases without requiring technical expertise. The performance of the models was comparatively evaluated using metrics such as Execution Accuracy and BLEU Score, revealing which model architecture provides superior results for NL-to-SQL tasks. The evaluation results revealed a clear performance hierarchy among the models. The Bart-Large model demonstrated superior performance, achieving the highest Skors across both metrics with an Execution Accuracy of 45% and a BLEU Score of 34.82%. The T5-Base model ranked second, with Skors of 35% and 30.29% respectively. Notably, a significant discrepancy was observed for the ProphetNet model; while its Execution Accuracy of 34% was comparable to that of T5-Base, its BLEU Score was substantially lower at 4.25%. This suggests that ProphetNet is capable of generating functionally vii correct queries through syntactic structures that diverge considerably from the reference examples. Ultimately, this study presents a systematic framework with technical and educational value, analyzing the effectiveness of state of the art artificial intelligence methods in making database queries more accessible. The findings are intended to serve as a valuable guide for researchers and practitioners pursuing similar work in this domain.
Creating a natural language to sql conversıon system with large language model support In recent years, the amount of data produced worldwide and the need to process this data have increased at a staggering rate. Organizations and individuals now require faster and more effective access to information stored in large databases, making database management and query processes more crucial than ever. However, writing complex SQL queries remains a significant technical barrier for most users. Consequently, there is a growing demand for intelligent systems that enable users to interact with databases easily through natural language. In this study, the design, training, and implementation of a system that automatically converts natural language queries into SQL statements are presented. The system leverages three large language models, each representing different architectural approaches and developed by leading research groups. For this purpose, the pretrained T5-Base model developed by Google (with approximately 220 million parameters), BART-Large by Facebook/ Meta (406 million parameters), and ProphetNet by Microsoft (400 million parameters) were utilized. These models were specifically fine-tuned on the Spider dataset, with data preparation and optimization processes meticulously carried out on high-performance cloud-based infrastructure. The developed application aims to allow users to query databases without requiring technical expertise. The performance of the models was comparatively evaluated using metrics such as Execution Accuracy and BLEU Score, revealing which model architecture provides superior results for NL-to-SQL tasks. The evaluation results revealed a clear performance hierarchy among the models. The Bart-Large model demonstrated superior performance, achieving the highest Skors across both metrics with an Execution Accuracy of 45% and a BLEU Score of 34.82%. The T5-Base model ranked second, with Skors of 35% and 30.29% respectively. Notably, a significant discrepancy was observed for the ProphetNet model; while its Execution Accuracy of 34% was comparable to that of T5-Base, its BLEU Score was substantially lower at 4.25%. This suggests that ProphetNet is capable of generating functionally vii correct queries through syntactic structures that diverge considerably from the reference examples. Ultimately, this study presents a systematic framework with technical and educational value, analyzing the effectiveness of state of the art artificial intelligence methods in making database queries more accessible. The findings are intended to serve as a valuable guide for researchers and practitioners pursuing similar work in this domain.
