Natural language to SQL

Hi Spen,

This is a super interesting and ambitious project. In fact, we were working on something similar when we decided to start building Rasa!

Writing a SQL generation layer manually is very tedious and error prone

Yes, but training a neural net to do the same is also difficult :slight_smile: remember that you will have to create a model for the specific schema you are working with. So I would strongly doubt you can take something off the shelf and work with it. Do you have data you can train on?

My advice would be to start simple. Define entities for the things you need (essentially the SQL verbs). Your training data would look something like:

[How many](aggregation) [purchases](item) were made [yesterday](filter:date)?
Show me the [total](aggregation) number of [customers](item) by [country](groupby)

You can then combine those entities to write a SQL query for your DB. Once you have something (basic) that’s working, you can give it to people to test and generate more training data. I suspect you’ll need quite a lot in order to train one of the neural models :slight_smile: