Skip to content

In this repository, you will find an example code for creating an interactive chat experience that allows you to ask questions about your CSV data with chart visualization capabilities.

Notifications You must be signed in to change notification settings

easonlai/chat_with_csv_streamlit_with_chart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat with your CSV (with chart visualization)

In this repository, you will find an example code for creating an interactive chat experience that allows you to ask questions about your CSV data. The code uses Pandas Dataframe Agent from LangChain and a GPT model from Azure OpenAI Service to interact with the data. To make the chat more versatile, I incorporated some prompt engineering techniques that instruct the GPT model to use the popular data visualization library, Matplotlib, to create charts based on your queries. The chart is then saved and visualized using the Streamlit frontend interface. This feature can create any type of chart (pie, line, scatter, etc.) as long as you provide clear instructions. Additionally, the code can also return the dataframe as a table or provide a straightforward answer.

The data for analysis is sourced from Kaggle's Telco Customer Churn dataset, providing a comprehensive view of customer information to develop effective retention programs.

To run this Streamlit web app

streamlit run run.py

Sample query to give a straightforward answer. alt text

Sample query to show the result in the table. alt text

Sample query to show the result in a bar chart. alt text

Sample query to show the result in a pie chart. alt text

Enjoy!

About

In this repository, you will find an example code for creating an interactive chat experience that allows you to ask questions about your CSV data with chart visualization capabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published