2
2
3
3
<div align =" center " >
4
4
5
- [ ![ Made with Azure OpenAI ] ( https://img.shields.io/badge/Made%20with-Azure%20OpenAI-0078D4 ?style=for-the-badge&logo=microsoftazure )] ( https://azure.microsoft.com/products/cognitive-services/openai-service / )
5
+ [ ![ Made with Google Gemini ] ( https://img.shields.io/badge/Made%20with-Google%20Gemini-4285F4 ?style=for-the-badge&logo=google )] ( https://deepmind.google/technologies/gemini / )
6
6
[ ![ Built with Streamlit] ( https://img.shields.io/badge/Built%20with-Streamlit-FF4B4B?style=for-the-badge&logo=streamlit )] ( https://streamlit.io )
7
7
[ ![ Database] ( https://img.shields.io/badge/Database-PostgreSQL%20%7C%20SQLite-336791?style=for-the-badge&logo=postgresql )] ( https://www.postgresql.org/ )
8
8
22
22
<summary >🎯 Core Features</summary >
23
23
24
24
- ** Natural Language to SQL** 🗣️ → 📝
25
- - Convert text queries into SQL commands using Azure OpenAI
26
- - Intelligent query interpretation and generation
25
+ - Convert text queries into SQL commands using Google's Gemini Pro model
26
+ - Intelligent query interpretation with detailed decision logs
27
+ - Step-by-step reasoning for query generation
27
28
- ** Multi-Database Support** 🗄️
28
- - SQLite compatibility
29
- - PostgreSQL integration
30
- - Dynamic database switching
29
+ - SQLite compatibility with file upload
30
+ - PostgreSQL integration with secure connection
31
+ - Dynamic schema exploration
31
32
- ** Interactive Data Explorer** 🔍
32
- - Real-time data filtering
33
- - Interactive query results
34
- - Dynamic table views
33
+ - Real-time data filtering and exploration
34
+ - Comprehensive query results with summary statistics
35
+ - Advanced table views with sorting and filtering
35
36
36
37
</details >
37
38
38
39
<details >
39
40
<summary >📊 Visualization & Analytics</summary >
40
41
41
42
- ** Dynamic Visualizations** 📈
42
- - Multiple chart types
43
- - Interactive configurations
44
- - Smart visualization suggestions ⭐️
43
+ - Multiple chart types (Bar, Line, Scatter, Area, Histogram)
44
+ - Interactive chart configuration
45
+ - AI-powered visualization recommendations
45
46
- ** Summary Statistics** 📋
46
- - Numeric data insights
47
- - Categorical analysis
48
- - Trend identification
47
+ - Detailed numeric analysis
48
+ - Categorical data insights
49
+ - Distribution analysis
50
+ - Statistical measures (mean, median, mode, skewness, kurtosis)
49
51
50
52
</details >
51
53
52
54
<details >
53
55
<summary >🛡️ Security & Management</summary >
54
56
55
57
- ** Safe SQL Execution** 🔒
56
- - Query validation
58
+ - Strict query validation
57
59
- SQL injection prevention
58
- - Error handling
60
+ - Comprehensive error handling and feedback
59
61
- ** Query History** 📚
60
- - Searchable log
61
- - Re-runnable queries
62
- - Export capabilities
62
+ - Searchable query log
63
+ - Query reusability
64
+ - Multiple export formats (CSV, Excel, JSON)
63
65
64
66
</details >
65
67
66
68
## 🚀 Getting Started
67
69
68
70
``` mermaid
69
71
graph LR
70
- A[User Input] --> B[NLP Engine ]
72
+ A[User Input] --> B[Gemini Pro ]
71
73
B --> C[SQL Generator]
72
74
C --> D[Database]
73
75
D --> E[Results]
@@ -79,7 +81,7 @@ graph LR
79
81
1️⃣ ** Clone the Repository**
80
82
81
83
``` bash
82
- git clone https://github.com/lohitkolluri /NLP2SQL.git
84
+ git clone https://github.com/yourusername /NLP2SQL.git
83
85
cd NLP2SQL
84
86
```
85
87
@@ -88,10 +90,7 @@ cd NLP2SQL
88
90
``` bash
89
91
# Create .env file
90
92
cat << EOF > .env
91
- OPENAI_API_KEY="Your Azure OpenAI API Key"
92
- OPENAI_ENDPOINT="https://name_of_openai_resource.openai.azure.com/"
93
- OPENAI_API_VERSION="API Version"
94
- MODEL_NAME="Name of Your Model from Azure OpenAI"
93
+ GOOGLE_API_KEY="Your Google Gemini API Key"
95
94
EOF
96
95
```
97
96
@@ -111,12 +110,12 @@ streamlit run app/NLP2SQL.py
111
110
112
111
<div align =" center " >
113
112
114
- | Technology | Purpose |
115
- | :------------------------------------------------------------------------------------------------------- : | :------------: |
116
- | ![ Streamlit] ( https://img.shields.io/badge/Streamlit-FF4B4B?style=flat-square&logo=streamlit ) | Web Interface |
117
- | ![ Azure OpenAI ] ( https://img.shields.io/badge/Azure%20OpenAI-0078D4 ?style=flat-square&logo=microsoftazure ) | NLP Processing |
118
- | ![ PostgreSQL] ( https://img.shields.io/badge/PostgreSQL-336791?style=flat-square&logo=postgresql ) | Database |
119
- | ![ Altair] ( https://img.shields.io/badge/Altair-005571?style=flat-square ) | Visualizations |
113
+ | Technology | Purpose |
114
+ | :-------------------------------------------------------------------------------------------------: | :------------: |
115
+ | ![ Streamlit] ( https://img.shields.io/badge/Streamlit-FF4B4B?style=flat-square&logo=streamlit ) | Web Interface |
116
+ | ![ Google Gemini ] ( https://img.shields.io/badge/Google%20Gemini-4285F4 ?style=flat-square&logo=google ) | NLP Processing |
117
+ | ![ PostgreSQL] ( https://img.shields.io/badge/PostgreSQL-336791?style=flat-square&logo=postgresql ) | Database |
118
+ | ![ Altair] ( https://img.shields.io/badge/Altair-005571?style=flat-square ) | Visualizations |
120
119
121
120
</div >
122
121
@@ -127,16 +126,16 @@ mindmap
127
126
root((NLP2SQL))
128
127
Query Processing
129
128
Natural Language Input
130
- SQL Generation
131
- Validation
129
+ Decision Logging
130
+ Detailed Reasoning
132
131
Visualization
133
- Charts
134
- Tables
135
- Statistics
132
+ Interactive Charts
133
+ Summary Statistics
134
+ Data Distribution
136
135
Database
137
136
PostgreSQL
138
137
SQLite
139
- Schema Explorer
138
+ Schema Analysis
140
139
Security
141
140
Query Validation
142
141
Error Handling
@@ -146,15 +145,37 @@ mindmap
146
145
## 💡 How It Works
147
146
148
147
1 . ** Query Input** ➡️ User enters natural language query
149
- 2 . ** Processing** ➡️ Azure OpenAI translates to SQL
150
- 3 . ** Execution** ➡️ Query runs against selected database
151
- 4 . ** Visualization** ➡️ Results displayed with appropriate charts
152
- 5 . ** Export** ➡️ Download results in preferred format
148
+ 2 . ** Processing** ➡️ Gemini Pro analyzes and generates SQL with reasoning
149
+ 3 . ** Validation** ➡️ Query is validated for safety and correctness
150
+ 4 . ** Execution** ➡️ Query runs against selected database
151
+ 5 . ** Analysis** ➡️ Results are processed with summary statistics
152
+ 6 . ** Visualization** ➡️ Data is presented with AI-recommended charts
153
+ 7 . ** Export** ➡️ Results can be downloaded in multiple formats
153
154
154
- <div align =" center " >
155
+ ## 📊 Supported Visualizations
156
+
157
+ - ** Bar Chart** : Comparing categorical data
158
+ - ** Line Chart** : Time-series and trend analysis
159
+ - ** Scatter Plot** : Relationship between variables
160
+ - ** Area Chart** : Cumulative totals and trends
161
+ - ** Histogram** : Distribution analysis
162
+
163
+ ## 🔒 Security Features
155
164
156
- ### 🌟 Start Exploring Your Data Today!
165
+ - Strict SQL query validation
166
+ - Prevention of harmful SQL operations
167
+ - Secure database connections
168
+ - Protected sensitive information
169
+ - Input sanitization
157
170
158
- ---
171
+ ## 📈 Data Analysis
172
+
173
+ - Comprehensive summary statistics
174
+ - Distribution analysis
175
+ - Correlation detection
176
+ - Trend identification
177
+ - Outlier detection
178
+
179
+ <div align =" center " >
159
180
160
181
</div >
0 commit comments