Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

lohitkolluri/NLP2SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

Made with Azure OpenAIMade with GeminiBuilt with StreamlitDatabase

🎯 Transform natural language into powerful SQL queries with ease!

Magnifying Glass Turn your words into SQL magicChart Visualize your data dynamicallyTabs Multi-database support

✨ Features

🎯 Core Features
  • Natural Language to SQL 🗣️ → 📝
    • Convert text queries into SQL commands usingAzure OpenAI orGemini models
    • Intelligent query interpretation with detailed decision logs
    • Step-by-step reasoning for query generation
  • Multimodal Interaction 🎥
    • Process both textual and visual inputs for richer query context
    • Combine image data with text to enhance query generation
  • Multi-Database Support 🗄️
    • SQLite compatibility with file upload
    • PostgreSQL integration with secure connection
    • Dynamic schema exploration
  • Interactive Data Explorer 🔍
    • Real-time data filtering and exploration
    • Comprehensive query results with summary statistics
    • Advanced table views with sorting and filtering
📊 Visualization & Analytics
  • Dynamic Visualizations 📈
    • Multiple chart types (Bar, Line, Scatter, Area, Histogram)
    • Interactive chart configuration
    • AI-powered visualization recommendations
  • Summary Statistics 📋
    • Detailed numeric analysis
    • Categorical data insights
    • Distribution analysis
    • Statistical measures (mean, median, mode, skewness, kurtosis)
🛡️ Security & Management
  • Safe SQL Execution 🔒
    • Strict query validation
    • SQL injection prevention
    • Comprehensive error handling and feedback
  • Query History 📚
    • Searchable query log
    • Query reusability
    • Multiple export formats (CSV, Excel, JSON)

🚀 Getting Started

graph LR    A[User Input] --> B[LLM Processing]    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/NLP2SQLL.gitcd NLP2SQL

2️⃣Set Up Environment

# Create .env filecat<<EOF > .env### 2a: Azure ConfigurationLLM_PROVIDER=AZUREOPENAI_ENDPOINT="https://[ENDPOINT_NAME].openai.azure.com"OPENAI_API_VERSION="2024-08-01-preview"OPENAI_API_KEY="YOUR AZURE OPENAI API KEY"MODEL_NAME="YOUR AZURE OPENAI MODEL NAME"### 2b: Gemini ConfigurationLLM_PROVIDER=GEMINIGEMINI_API_KEY="YOUR GEMINI API KEY"EOF

3️⃣Install Dependencies

pip install -r requirements.txt

4️⃣Launch the App

streamlit run app/NLP2SQL.py

🎨 Built With

TechnologyPurpose
StreamlitWeb Interface
Azure OpenAINLP Processing
GeminiNLP Processing
PostgreSQLPostgreSQL DB
SQLiteSQLite DB
PlotlyVisualizations

🌟 Key Features

mindmap  root((NLP2SQL))    Query Processing      Natural Language Input      Decision Logging      Detailed Reasoning    Visualization      Interactive Charts      Summary Statistics      Data Distribution    Database      PostgreSQL      SQLite      Schema Analysis    Security      Query Validation      Error Handling      Safe Execution
Loading

💡 How It Works

  1. Query Input ➡️ User enters natural language query
  2. Processing ➡️ Azure OpenAI analyzes and generates SQL with reasoning
  3. Validation ➡️ Query is validated for safety and correctness
  4. Execution ➡️ Query runs against selected database
  5. Analysis ➡️ Results are processed with summary statistics
  6. Visualization ➡️ Data is presented with AI-recommended charts
  7. Export ➡️ Results can be downloaded in multiple formats

📊 Supported Visualizations

  • Bar Chart: Comparing categorical data
  • Line Chart: Time-series and trend analysis
  • Scatter Plot: Relationship between variables
  • Area Chart: Cumulative totals and trends
  • Histogram: Distribution analysis

🔒 Security Features

  • Strict SQL query validation
  • Prevention of harmful SQL operations
  • Secure database connections
  • Protected sensitive information
  • Input sanitization

📈 Data Analysis

  • Comprehensive summary statistics
  • Distribution analysis
  • Correlation detection
  • Trend identification
  • Outlier detection

License ©Lohit Kolluri

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


[8]ページ先頭

©2009-2025 Movatter.jp