Return to search

[pt] CONSULTANDO BANCOS DE DADOS COM LINGUAGEM NATURAL: O USO DE MODELOS DE LINGUAGEM GRANDES PARA TAREFAS DE TEXTO-PARA-SQL / [en] QUERYING DATABASES WITH NATURAL LANGUAGE: THE USE OF LARGE LANGUAGE MODELS FOR TEXT-TO-SQL TASKS

[pt] A tarefa chamada brevemente de Texto-para-SQL envolve a geração de uma consulta SQL com base em um banco de dados relacional e uma pergunta em linguagem natural. Embora os rankings de benchmarks conhecidos indiquem que Modelos de Linguagem Grandes (LLMs) se destacam nessa tarefa, eles são avaliados em bancos de dados com esquemas bastante simples. Esta dissertação investiga inicialmente o desempenho de modelos Texto-para-SQL baseados em LLMs em um banco de dados disponível ao público (Mondial)com um esquema conceitual complexo e um conjunto de 100 perguntas em Linguagem Natural (NL). Executando sob GPT-3.5 e GPT-4, os resultados deste primeiro experimento mostram que as ferramentas baseadas em LLM têm desempenho significativamente inferior ao relatado nesses benchmarks e enfrentam dificuldades com a vinculação de esquemas e joins, sugerindo que o esquema relacional pode não ser adequado para LLMs. Essa dissertação propõe então o uso de visões e descrições de dados amigáveis ao LLM para melhorara precisão na tarefa Texto-para-SQL. Em um segundo experimento, usando a estratégia com melhor performance, custo e benefício do experimento anterior e outro conjunto com 100 perguntas sobre um banco de dados do mundo real, os resultados mostram que a abordagem proposta é suficiente para melhorar consideravelmente a precisão da estratégia de prompt. Esse trabalho conclui com uma discussão dos resultados obtidos e sugere abordagens adicionais para simplificar a tarefa de Texto-para-SQL. / [en] The Text-to-SQL task involves generating an SQL query based on a
given relational database and a Natural Language (NL) question. While the
leaderboards of well-known benchmarks indicate that Large Language Models
(LLMs) excel in this task, they are evaluated on databases with simpler
schemas. This dissertation first investigates the performance of LLM-based
Text-to-SQL models on a complex and openly available database (Mondial)
with a large schema and a set of 100 NL questions. Running under GPT-3.5
and GPT-4, the results of this first experiment show that the performance of
LLM-based tools is significantly less than that reported in the benchmarks
and that these tools struggle with schema linking and joins, suggesting that
the relational schema may not be suitable for LLMs. This dissertation then
proposes using LLM-friendly views and data descriptions for better accuracy
in the Text-to-SQL task. In a second experiment, using the strategy with
better performance, cost and benefit from the previous experiment and another
set with 100 questions over a real-world database, the results show that the
proposed approach is sufficient to considerably improve the accuracy of the
prompt strategy. This work concludes with a discussion of the results obtained
and suggests further approaches to simplify the Text-to-SQL task.

Identiferoai:union.ndltd.org:puc-rio.br/oai:MAXWELL.puc-rio.br:66799
Date23 May 2024
CreatorsEDUARDO ROGER SILVA NASCIMENTO
ContributorsMARCO ANTONIO CASANOVA, MARCO ANTONIO CASANOVA, MARCO ANTONIO CASANOVA
PublisherMAXWELL
Source SetsPUC Rio
LanguageEnglish
Detected LanguageEnglish
TypeTEXTO

Page generated in 0.0023 seconds