Chatbot for CSV data with calculations

Muhammad Zubair 30 Reputation points
2023-10-11T17:51:38.9066667+00:00

I am looking for a chatbot that can respond to questions about CSV data, including making calculations on the data. I have added all of my CSV files as indexers in Cognitive Search, and the chatbot is responding correctly to questions about individual records. However, when I ask a general question, such as "What is the sum of all amounts from 2/2/2023 to 3/3/2023?", the chatbot does not respond correctly. It seems that the chatbot is only responding to questions about individual row, not to questions that require calculations on multiple rows or columns. Can anyone help me to achieve this?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,915 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,350 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee
    2023-10-12T20:00:19.7366667+00:00

    @Muhammad Zubair Applying on LLMs on Tabular Data is a bit trickier compared to asking it questions about regular textual facts. In many cases, it would be impossible to pass in the complete tabular data into the prompt due to token limits, but it should work for data that can fit in the prompt.

    In these cases, you would need to bring in all your data instead of using Azure Cognitive Search to fetch semantically relevant information, which is what Azure OpenAI on your Data does. Unfortunately, there is no way to change this behavior since this is by design.

    Another approach would be to ingest aggregate information (like a pivot table in excel), which could be fetched during retrieval from Cognitive Search with the right prompt.

    With more complex use cases like this where you might need to perform auxiliary autonomous tasks (like querying a database for example), it might be worthwhile to explore frameworks like Semantic Kernel which could help orchestrate and build more complex AI-powered workflows.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.