{"id":19513898,"url":"https://github.com/easonlai/chat_with_csv_streamlit_with_chart","last_synced_at":"2025-04-26T05:32:11.615Z","repository":{"id":194812051,"uuid":"691641429","full_name":"easonlai/chat_with_csv_streamlit_with_chart","owner":"easonlai","description":"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.","archived":false,"fork":false,"pushed_at":"2023-09-14T15:52:35.000Z","size":452,"stargazers_count":14,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T08:21:49.459Z","etag":null,"topics":["azure-openai","azure-openai-api","azure-openai-service","chart-visualization","data-analysis","data-visualization","gpt","gpt-3","langchain","langchain-python","matplotlib","openai","python","streamlit","streamlit-webapp"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easonlai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-14T15:26:16.000Z","updated_at":"2025-02-28T20:11:21.000Z","dependencies_parsed_at":"2023-09-15T07:33:53.147Z","dependency_job_id":null,"html_url":"https://github.com/easonlai/chat_with_csv_streamlit_with_chart","commit_stats":null,"previous_names":["easonlai/chat_with_csv_streamlit_with_chart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easonlai%2Fchat_with_csv_streamlit_with_chart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easonlai%2Fchat_with_csv_streamlit_with_chart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easonlai%2Fchat_with_csv_streamlit_with_chart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easonlai%2Fchat_with_csv_streamlit_with_chart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easonlai","download_url":"https://codeload.github.com/easonlai/chat_with_csv_streamlit_with_chart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250937237,"owners_count":21510927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-openai","azure-openai-api","azure-openai-service","chart-visualization","data-analysis","data-visualization","gpt","gpt-3","langchain","langchain-python","matplotlib","openai","python","streamlit","streamlit-webapp"],"created_at":"2024-11-10T23:33:36.913Z","updated_at":"2025-04-26T05:32:10.923Z","avatar_url":"https://github.com/easonlai.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chat with your CSV (with chart visualization)\n\nIn 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](https://python.langchain.com/docs/integrations/toolkits/pandas) from [LangChain](https://python.langchain.com/docs/get_started/introduction) and a [GPT model](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models) from [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) 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](https://matplotlib.org/stable/index.html), to create charts based on your queries. The chart is then saved and visualized using the [Streamlit](https://streamlit.io/) frontend interface. This feature can create any [type of chart](https://matplotlib.org/stable/plot_types/index.html) (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.\n\nThe data for analysis is sourced from [Kaggle's Telco Customer Churn](https://www.kaggle.com/datasets/blastchar/telco-customer-churn) dataset, providing a comprehensive view of customer information to develop effective retention programs.\n\n**To run this Streamlit web app**\n```\nstreamlit run run.py\n```\n\n**Sample query to give a straightforward answer.**\n![alt text](https://github.com/easonlai/chat_with_csv_streamlit_with_chart/blob/main/git-images/git-image-1.png)\n\n**Sample query to show the result in the table.**\n![alt text](https://github.com/easonlai/chat_with_csv_streamlit_with_chart/blob/main/git-images/git-image-2.png)\n\n**Sample query to show the result in a bar chart.**\n![alt text](https://github.com/easonlai/chat_with_csv_streamlit_with_chart/blob/main/git-images/git-image-3.png)\n\n**Sample query to show the result in a pie chart.**\n![alt text](https://github.com/easonlai/chat_with_csv_streamlit_with_chart/blob/main/git-images/git-image-4.png)\n\nEnjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasonlai%2Fchat_with_csv_streamlit_with_chart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasonlai%2Fchat_with_csv_streamlit_with_chart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasonlai%2Fchat_with_csv_streamlit_with_chart/lists"}