Recently, have started working on the idea of conversational chatbot and have been thinking of different ways to convert Natural Language query to SQL. These are some of the libraries I have shortlisted to evaluate before writing from scratch. Any other ideas or suggestions?
Comprehending natural language text, with its first-hand challenges of ambiguity and co-reference, has been a longstanding problem in Natural Language Processing (NLP).
Step 1:Downloading a txt file via FTP to a local drive. Step 2:Convert the file to SQL. Step 3:Copy the file to another FTP location. Step 4:Delete the file from the local drive.
mysql - Which database can be used to store processed data from NLP engine - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
NLP to SQL web service is used for unstructured Natural Language user request transformation into Structured Query Language. For this tutorial, we are using NLSQL. For NLSQL customization you should have database schema and Q&A samples you would like to use.
What we’re really asking here is how to convert natural human language into valid SQL queries. By itself, natural language processing ( NLP) is one of the most challenging areas in AI research, and translating that question into a valid SQL query introduces a whole new layer of complexity.
For NLSQL customization you should have database schema and Q&A samples you would like to use. For NLP to API webservice you should have your API web service documentation as well as Q&A dialog sample.
This article presents detail instructions on how technically skilled experts can implement cognitive automation use cases and provide non-technical employees intuitive access to enterprise data by Natural Language Interface. NLP to SQL API is used for unstructured Natural Language user request transformation into Structured Query Language.
check this demo from AllenNLP: https://demo.allennlp.org/atis-parser
Which converts Natural Language text into SQL queries. They also have python library allennlp
.
Here is their github repo: https://github.com/allenai/allennlp
For documentation regarding semantic_parsing:
https://allenai.github.io/allennlp-docs/api/allennlp.data.dataset_readers.semantic_parsing.html
The main challenge here is to fit end-user needs. Most of the end-users are not technically skilled enough and they don't know database schema.
All open-sourced libraries mentioned here requires to use column names inside input requests, so end-user should design request as "give me count for column_name where column_name is lower than 120". This assumption is wrong because end-users usually don't care about database structure and column names. With open-source libraries, you can create another Structure Query Language layer on top of the usual SQL.
I would recommend having a look at NLP libraries before building your service:
BERT ==== https://github.com/hanxiao/bert-as-service
Sentence Transformers ==== https://github.com/UKPLab/sentence-transformers
VaderSentiment ==== https://github.com/cjhutto/vaderSentiment
Also, I would recommend having a look at NLP to SQL software architecture and existing commercial software for Natural Language to SQL
Check this open source Python framework (started in 2014):
Quepy is a framework to convert natural language to database queries. It can be easily customized to different kinds of questions in natural language and database queries. So, with little coding you can build your own system for natural language access to your database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With