Master LLMs with our FREE course in collaboration with Activeloop & Intel Disruptor Initiative. Join now!

Publication

Create a SuperPrompt for Natural Language to SQL Conversion for OpenAI.
Latest   Machine Learning

Create a SuperPrompt for Natural Language to SQL Conversion for OpenAI.

Last Updated on November 5, 2023 by Editorial Team

Author(s): Pere Martra

Originally published on Towards AI.

One of the things that has changed more in recent months, since the ChatGPT boom, is the emergence of massive large language models able to learn to perform tasks with just two or three examples. We will use this capability to create a prompt that allows OpenAI Models to generate SQL commands from Natural Language.

This article is part of a free course about Large Language Models available on GitHub.

Image generated by Author using Dall-E2.

In this article, we will see how to create a prompt so that OpenAI’s GPT models can perform NL2SQL tasks. That is, translating user language requests into SQL commands that will retrieve the requested data.

To do this, we will start from a paper from Ohio University: ‘How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settings.’ We will modify what we already saw in the second article of the Large Language Models Course.

The prompt will consist of… Read the full blog for free on Medium.

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓