The Excel Plotter Chatbot is an innovative application that combines natural language processing with data visualization. It allows users to interact with their Excel data through a chatbot interface, generating charts and graphs based on natural language queries. This project leverages advanced language models and plotting libraries to create a seamless experience for data analysis and visualization.
- Natural language interface for querying Excel data
- Dynamic chart generation based on user queries
- Support for various chart types (line, bar, etc.)
- Real-time data processing and visualization
- Integration of LLM (Large Language Model) for query understanding
- Image verification to ensure chart accuracy
- BART (facebook/bart-large): Fine-tuned for understanding and processing natural language queries related to data visualization.
- CLIP (openai/clip-vit-base-patch32): Used for image verification to ensure the generated charts match the user's query.
-
train_model.py:
- Script for fine-tuning the BART model on custom dataset and the model is saved as fine-tuned-bart-large
-
app.py:
- Initializes Flask application
- Defines API endpoints for handling requests
- Manages static file serving
-
llm_agent.py:
- Processes user queries using the fine-tuned BART model
- Coordinates between data processing, chart generation, and image verification
-
data_processor.py:
- Handles loading and preprocessing of Excel data
-
chart_generator.py:
- Generates charts based on processed queries using Matplotlib
-
image_verifier.py:
- Verifies generated charts against user queries using CLIP model
-
Now one can see the chart posted on the app
-
index.js:
- Entry point for React application
-
App.js:
- Main component managing overall application state
-
Chatbot.js:
- Handles user input and communication with backend API
-
ChartDisplay.js:
- Renders the generated chart image
- Enter your query in natural language (e.g., "plot the sales in the years with red line")
- The system processes your query and generates a relevant chart
- The chart is displayed on the screen
git clone https://github.com/Transcendental-Programmer/LLM-Integrated-Excel-Plotter-App.git
cd LLM-Integrated-Excel-Plotter-App
-
Create a virtual environment:
python -m venv myenv myenv\Scripts\activate
-
Install required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the backend directory and add the hugging face API key, you can get one for free from the web https://huggingface.co/. -
change to backend
cd backend
-
Run the train_model.py
python train_model.py
-
Run the backend server:
python app.py
The API should now be running on http://localhost:5000
.
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
Interact with the app opened on http://localhost:8080
Contributions to improve the Excel Plotter Chatbot are welcome. Please feel free to submit pull requests or open issues to discuss proposed changes.