Skip to content

Open AI GPT-3 language mode used for natural language to SQL query generation

Notifications You must be signed in to change notification settings

rajshekharM/gpt-3-NLP-to-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gpt-3-NLP-to-SQL

Open AI GPT-3 language mode used for natural language to SQL query generation

OpenAI's new language model which is named as GPT-3 and is now by far the largest language model right now. It has beem trained on 175 billion parameters and essentially on all the data that is available on the internet. So it can essentially be used as a simple search engine like google or wikipedia. Or as a language translator.

SQL code or for that matter any computer language code, is essentially, a language to communicate certain instructions to the computer. So in that essence, this GPT-3 model should also be able to transfer any normal language request from user into a code needed. On those lines, I thought why can't it be also used to transfer any natural language sentence or question into a fully funcrional SQL query , which can give us results when run against an actual database.

SUre enough! It can be!

It is able to generate SQL queries from natural language, and that too without much training.

It takes in 10-20 question-SQL pairs and starts spitting out SQL query for a given natural language question.

It must be due to the fact that it has been trained on essentially so much data, which would also have included SQL queries, that it can easily identify the links between NLP and SQL. One of the explainations, perhaps, of this almost mind-blowing model!

Enjoy!

Credits for the code - Bhavesh Bhatt : repo :https://github.com/bhattbhavesh91/gpt-3-simple-tutorial

About

Open AI GPT-3 language mode used for natural language to SQL query generation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published