[HN Gopher] Show HN: Describe SQL using natural language, and ex...
       ___________________________________________________________________
        
       Show HN: Describe SQL using natural language, and execute against
       real data
        
       I played around with GPT-3 to build this demo. Select a public
       BigQuery dataset and describe your query in natural English, then
       edit the generated SQL as needed and execute it.
       https://app.tabbydata.com/sql-assistant-demo
        
       Author : napoleond
       Score  : 40 points
       Date   : 2021-12-16 17:57 UTC (5 hours ago)
        
       | talos2110 wrote:
       | Nice!
       | 
       | As an interesting test case, check out the very strange and
       | seemingly recursive query generated for "Get the top 10 authors
       | of caching libraries, ranked by commit volume"
        
       | napoleond wrote:
       | Clickable link: https://app.tabbydata.com/sql-assistant-demo
        
       | i_like_apis wrote:
       | This is pretty cool.
       | 
       | I thought it was funny in that in the weather dataset that "NULL"
       | comes in first for the win for some questions:
       | 
       | > what is the all time rainiest city? > what are the top 5 most
       | dry states?
       | 
       | The query conversion is impressive!
        
         | napoleond wrote:
         | The weather dataset has a bit of an unorthodox schema IMO,
         | which gives the model more trouble than usual. That's kind of
         | the point of this demo, though: to what extent is generated SQL
         | like this useful--despite its flaws--in the context of real-
         | world datasets? Jury is still out :)
        
       | mjirv wrote:
       | Very nice! I've been working on something similar recently:
       | https://acolytehq.com.
       | 
       | Would be happy to chat and compare notes if you'd like!
        
         | napoleond wrote:
         | Awesome! Always happy to chat; my contact info is in my profile
         | (and also at the bottom of the linked demo).
        
       | paulfitz wrote:
       | For google-trends it translated "Is there anything cat-related
       | that people are excited about?" to something very reasonable that
       | worked (answer: popcat apparently). Nice!
        
         | napoleond wrote:
         | Really? Wow, I would not have expected that to work. Might be
         | one advantage of using this general model instead of a more
         | specialized one.
        
       | cafed00d wrote:
       | Wow, this is absolutely brilliant!
       | 
       | How can I extend this to use other datasets? There seem to be
       | quite a few interesting publicly available datasets out there:
       | https://console.cloud.google.com/marketplace/browse?filter=s...
       | 
       | and I'm wondering if: 1. Is there a paid-for version of your
       | app/website where I can plug in a diff dataset? 2. Have you
       | considered sharing the source code for others to recreate and
       | plug in diff datasets? 3. Or, :sweat_smile:, perhaps this is as
       | simple as adding new datasets to the drop-down menu? say, finance
       | data / Bitcoin transactions data?
       | 
       | Regardless, really cool app!
        
       | earleybird wrote:
       | May be some rough edges - or I have unreasonable expecations. The
       | weather data set has 'begin' and 'end' columns which generates
       | bad sql.
       | 
       | ie, "ERROR: Syntax error: Expected end of input but got keyword
       | END at [49:3]"
        
         | napoleond wrote:
         | Yeah many rough edges indeed. The generated SQL is the plain
         | output from GPT-3; I have not done anything to customize the
         | model or validate syntax outside it, so the roughness is
         | expected. No idea if folks will find value in this despite
         | that, hence the demo.
        
       | tillvz wrote:
       | Hey that's very cool and works surprisingly well!
       | 
       | At Veezoo (http://www.veezoo.com) we have been tackling this
       | problem for over 5 years now.
       | 
       | Under the hood we are using our own models. With GPT-3 we're a
       | bit worried about the lack of fine-grained control needed for
       | productive use-cases and obv. also lock in.
       | 
       | Will try out against the same dataset and see how it compares!
        
         | napoleond wrote:
         | Nice! Yeah I have no doubt that a specialized model could beat
         | this general one, although I find the output from the general
         | one to be uncanny at times. Would love to hear your expert
         | opinion on how they compare!
        
         | tluyben2 wrote:
         | Nice product, will give it a spin. For the banking market. Do
         | you have an API exposed as well to feed questions and get
         | (json) data? Our clients would definitely need it integrated
         | fully.
        
           | mritchie712 wrote:
           | not OP, but this is exactly what ThoughtSpot Everywhere is
           | for:
           | 
           | https://www.thoughtspot.com/everywhere
        
           | tillvz wrote:
           | Currently we don't have such an API exposed. Main reason is
           | the focus on offering a complete self-service analytics
           | solution (i.e. offering next to the NL2SQL also important
           | UI/UX components)
           | 
           | Still we have other ways of integrating it with other systems
           | e.g. exporting to CRMs. Also on the branding side it's
           | possible to have it in the companies corporate identity.
           | 
           | And just let me know if you wanna get a quick tour, happy to
           | show you around :)!
        
       | mritchie712 wrote:
       | We did a similar analysis a while back, works surprisingly well!
       | I OpenAI increases the amount of "training data" you can send in,
       | I think it could get really good at generating SQL.
       | 
       | https://blog.seekwell.io/gpt3
        
         | napoleond wrote:
         | Cool! Yes, the ability to customize the model
         | (https://openai.com/blog/customized-gpt3/) also seems like it
         | could be really useful for this.
        
       | 331c8c71 wrote:
       | Works unexpectedly well! As many others I am wondering how
       | difficult/costly it'd be to have this assistant set up for
       | another dataset.
        
       ___________________________________________________________________
       (page generated 2021-12-16 23:01 UTC)