Skip to content

Transform natural language into SQL queries using Azure OpenAI. Visualize database results with interactive charts and explore data effortlessly.

License

Notifications You must be signed in to change notification settings

lohitkolluri/NLP2SQL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP2SQL 🤖

Made with Azure OpenAI Built with Streamlit Database

🎯 Transform natural language into powerful SQL queries with ease!

Magnifying Glass Turn your words into SQL magic Chart Visualize your data dynamically Tabs Multi-database support

✨ Features

🎯 Core Features
  • Natural Language to SQL 🗣️ → 📝
    • Convert text queries into SQL commands using Azure OpenAI
    • Intelligent query interpretation and generation
  • Multi-Database Support 🗄️
    • SQLite compatibility
    • PostgreSQL integration
    • Dynamic database switching
  • Interactive Data Explorer 🔍
    • Real-time data filtering
    • Interactive query results
    • Dynamic table views
📊 Visualization & Analytics
  • Dynamic Visualizations 📈
    • Multiple chart types
    • Interactive configurations
    • Smart visualization suggestions ⭐️
  • Summary Statistics 📋
    • Numeric data insights
    • Categorical analysis
    • Trend identification
🛡️ Security & Management
  • Safe SQL Execution 🔒
    • Query validation
    • SQL injection prevention
    • Error handling
  • Query History 📚
    • Searchable log
    • Re-runnable queries
    • Export capabilities

🚀 Getting Started

graph LR
    A[User Input] --> B[NLP Engine]
    B --> C[SQL Generator]
    C --> D[Database]
    D --> E[Results]
    E --> F[Visualization]
Loading

Installation

1️⃣ Clone the Repository

git clone https://github.com/lohitkolluri/NLP2SQL.git
cd NLP2SQL

2️⃣ Set Up Environment

# Create .env file
cat << EOF > .env
OPENAI_API_KEY="Your Azure OpenAI API Key"
OPENAI_ENDPOINT="https://name_of_openai_resource.openai.azure.com/"
OPENAI_API_VERSION="API Version"
MODEL_NAME="Name of Your Model from Azure OpenAI"
EOF

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Launch the App

streamlit run app/NLP2SQL.py

🎨 Built With

Technology Purpose
Streamlit Web Interface
Azure OpenAI NLP Processing
PostgreSQL Database
Altair Visualizations

🌟 Key Features

mindmap
  root((NLP2SQL))
    Query Processing
      Natural Language Input
      SQL Generation
      Validation
    Visualization
      Charts
      Tables
      Statistics
    Database
      PostgreSQL
      SQLite
      Schema Explorer
    Security
      Query Validation
      Error Handling
      Safe Execution
Loading

💡 How It Works

  1. Query Input ➡️ User enters natural language query
  2. Processing ➡️ Azure OpenAI translates to SQL
  3. Execution ➡️ Query runs against selected database
  4. Visualization ➡️ Results displayed with appropriate charts
  5. Export ➡️ Download results in preferred format

🌟 Start Exploring Your Data Today!


About

Transform natural language into SQL queries using Azure OpenAI. Visualize database results with interactive charts and explore data effortlessly.

Topics

Resources

License

Stars

Watchers

Forks

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy