Giter Club home page Giter Club logo

nl2sql_looker's Introduction

Natural Language to SQL Demo

This uses Looker and LookML as pass through to create a data dictionary augmenting data using LLM's to better match semantic queries and return a standardized body that can be easily accessed by the looker api.

It's undergoing active development.

Pre-requisites

to do

  • create a virtual env virtualenv venv
  • activate virtualenv: source venv/bin/activate
  • install requirements: pip install -r requirements.txt
  • add a looker.ini file to the config directory
  • add an explore selector
  • evaluate results against existing code generation model e.g. text2sql, codey, gemini, gpt4 etc.

High Level

Using Looker to solve the existing NL to SQL problem that exists. In this process we can use LookML as an interstitial translation layer for asking natural language queries against a SQL database. Typically some of the issues with this problem exist around making sure the appropriate columns are selected, which requires querying the schema of the database. In addition complicated joins and unnesting are often not created by existing fine tuned code based LLM's such as codey/gemini etc.

This method steps.

  • Take the existing LookML and create a data dictionary
  • augment the datadictionary with context using an LLM
  • Create a LLM prompt to select the question intent and output a standardized response in JSON format
  • Use the json response to call Looker's robust api and return results.

The advantages of this method are:

  1. Easy to create an augmented data dictionary from LLM scanning LookML
  2. SQL generated is created by Looker to allow for complicated queries unnesting, joins etc.
  3. You can point this methods towards Dashboard filters, explores etc.

nl2sql_looker's People

Contributors

hugoselbie avatar sagravat avatar tjwebb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.