NLP2SQL is a project that aims to generate SQL queries from natural language text. It involves converting text input into a structured format to create a semantically correct SQL query for database execution.
Here are some of the project's best features:
- Natural Language to SQL: Convert natural language text to SQL queries.
- Dynamic Database Handling: Adapt to different database schemas dynamically.
- Data Display and Visualization: Present data in an intuitive and interactive manner.
- Report Generation: Generate comprehensive reports based on SQL queries.
- Performance Optimization: Optimized for efficiency and speed.
-
Clone the Repository:
git clone https://github.com/lohitkolluri/NLP2SQL.git cd NLP2SQL
-
Create and Activate a Virtual Environment:
-
On macOS/Linux:
python3 -m venv venv source venv/bin/activate
-
On Windows:
python -m venv venv .\venv\Scripts\activate
-
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.env
file in the root directory and add the necessary environment variables such as your Azure OpenAI endpoint and API key.OPENAI_ENDPOINT=https://your-azure-openai-endpoint OPENAI_API_KEY=your-azure-openai-api-key
-
Running the App:
streamlit run NLP2SQL.py
-
Access the App:
Open your web browser and go to:
http://localhost:8501
Technologies used in the project:
- Streamlit: For building the interactive web application.
- Altair: For data visualization.
- Python: The core programming language.
- SQLite: For the database.
- Pandas: For data manipulation.
- Azure OpenAI: For generating SQL queries from natural language input.
- GPT 3.5 Turbo: Model Used to Transcribe NLT to Sematic SQL.