NLPeXperts’: A Tabular Data Analysis Tool
Chatbot and Graph Plotter
Application Purpose
Bridge the gap between data and users by making the tool user-friendly and intuitive, minimizing the need for extensive knowledge of database structures or SQL.
Integrated data visualization tools to translate complex data into clear charts and graphs, facilitating exploration and understanding.
The tool can handle and analyze large datasets efficiently without performance degradation ensuring privacy.
Challenges faced while using Tabular data
As data volumes grow, querying complex tabular (SQL) databases can become slow and challenging. Writing efficient SQL queries and interpreting large datasets can be cryptic.
Tabular databases often lack a user-friendly interface, requiring users to understand the table structure and write complex queries to access data.
Complex queries, large datasets, and unfriendly interfaces delay and hinder decision-making. A streamlined solution is needed to provide timely insights through a user-friendly interface.
Architecture and Planning
CHATBOT
Steps involved when a user sends a natural language query in the chatbot:
GRAPH PLOTTER
Steps involved when a user sends a natural language query in the graph plotter:
Features of the Tool
Table images can be uploaded which can also be handwritten.
Tables can also be uploaded in CSV format.
Tables can be downloaded from the table modal to the device.
Users can also input messages using their voices.
User-friendly interface with dark mode feature.
The existing table list can be viewed by clicking on the button.
Sample questions are listed to assist users with a feature to copy them.
Can perform statistical analysis like calculating averages.
The tabular Data support history mechanism.
The tabular Data has multilingual support.
The tool can answer complex queries relating to more than one table
Select the table and specify the parameters to plot the graph or chart of any type
Download the plot that has been generated by the tool to the device.
A guide to aid users about the type of graphs.
Tables can be uploaded as images or as CSV file and can be viewed using show existing tables.
The chatbot and graph plotter is made responsive.
Creation Process
Purpose and Vision: The core idea behind the development of NLPeXperts was to create a comprehensive tool that bridges the gap between users and complex datasets by simplifying the process of accessing and analyzing tabular data. The goal was to make data analysis intuitive for users with little to no knowledge of SQL or database structures, while still offering advanced visualization features to aid in decision-making.
Challenges Identified: The primary challenge with traditional tabular databases was the steep learning curve associated with writing complex SQL queries. This issue was compounded by the large datasets users often needed to work with, leading to slow query processing and cryptic data outputs that hindered timely insights. A streamlined solution was necessary to simplify database access, automate query generation, and provide a user-friendly interface.
Solution Overview:
Chatbot for Querying: A natural language chatbot was implemented to allow users to input queries in plain language. This chatbot converts user queries into SQL commands, significantly lowering the barrier for interacting with large datasets. The chatbot works by sending user queries to an AI-powered backend, which interprets the query, converts it into SQL, and retrieves the corresponding data.
Graph Plotter for Data Visualization: Alongside the chatbot, a graph plotter was developed to provide data visualization capabilities. Users can generate graphs by describing the type of graph or the data they want to visualize. The tool converts the user’s input into Python code, executes it in the backend, and returns the plotted graph as an image, making it easy to understand complex datasets.
Development Stages:
Backend Infrastructure: The backend was built using Flask to handle natural language inputs and interface with the database. A crucial component was the integration of the Gemini API, a large language model (LLM) used for generating SQL queries and Python graphing code based on user input. This allowed the tool to automate the query and visualization process while maintaining accuracy and performance.
Query and Visualization Automation:
For SQL Queries: The chatbot automatically generates SQL queries by combining the user’s natural language input with a pre-programmed database schema.
For Graph Generation: The graph plotter dynamically generates Python code to plot the graph based on the structure of the data tables. This approach eliminated the need for users to write code themselves.
Database Connectivity: An SQLite database was chosen due to its lightweight nature and ease of integration. The database connection was managed through a series of functions that retrieved table names, column details, and sample data, ensuring that users could interact with the data without understanding its underlying structure.
User Interface and Features: The tool was designed with a user-friendly interface, including features such as file uploads, voice input, dark mode, and the ability to download tables and graphs. Multilingual support and a history mechanism were implemented to enhance user interaction.
Key Components added for enhanced performance:
Table and Column Recognition: Functions were created to dynamically retrieve table and column data from the SQLite database, allowing for real-time query generation.
Code Extraction: Python and SQL code blocks were extracted from the LLM’s responses and executed in real-time, providing immediate feedback to the user.
History Management: A history feature was implemented to store user interactions, enabling the tool to handle follow-up questions effectively.
Deployment and User Experience: The final tool was deployed with responsive web pages, allowing users to interact with the chatbot and graph plotter from any device. Routes were created to handle chatbot queries, graph plotting, file uploads, and data downloads, making the tool versatile and accessible.
CODE BLOCKS and their purpose
Routes on Website
/: Renders the homepage (index.html) and passes the AI-generated questions.
/graphs: Renders a page displaying available graphs (graphy.html).
/about: Renders an about page (about.html).
/get: Receives user input and responds with generated chatbot responses.
/graphy: Processes graph requests from the user and generates the required plot.
/listTable: Lists available tables in the SQLite database.
/selectTable: Allows users to select a table for downloading or further interaction.
/downloadTable: Provides the CSV download of a selected table.
/downloadGraph: Downloads the generated graph as a PNG image.
/addimg: Uploads an image and generates corresponding SQL commands to add data.
/addtable: Uploads a CSV file, processes it into the database, and updates the question generator.
/show: Fetches metadata about all tables in the SQLite database.
There are no datasets linked
There are no datasets linked