Fetch data from SQL Database using Natural language
Text2SQL project is aimed at developing a system that can interpret natural language queries and convert them into equivalent SQL queries and execute them using LLMs. Leveraging natural language processing (NLP) and semantic parsing techniques, Text2SQL bridges the gap between human language and structured query languages. This approach enables users to interact with databases more intuitively.
To run the ChatBot project locally, follow these steps:
-
Clone the Repository: git clone {repo url}
-
Install Dependencies: Navigate to the project directory and install the required dependencies: pip install -r requirements.txt
-
Add Google API Key: Obtain OPENAI API key and add it to the .env file in the project directory: OPENAI_API_KEY=your_openai_api_key
-
Add DATABASE Details: Obtain Database details like Hostname, Username, password, Database name and add it to the .env file in the project directory.
-
Run the Project: Launch the chatbot application using Streamlit: streamlit run NL2SQL.py
-
Interact with the ChatBot: Open your web browser and navigate to the provided URL to interact with ChatBot.
The project structure is organized as follows:
-
NL2SQL.py: Main application file containing the Streamlit user interface and chatbot functionality.
-
requirements.txt: List of Python dependencies required to run the project.
-
.env: Environment configuration file for storing sensitive information (e.g., API keys).
-
README.md: Project documentation file.