Chatting with your Large Datasets using Azure Cognitive Search, Azure Open AI, and ChatGPT
In today’s blog, we’re going to cover how you can leverage Azure Cognitive Search, Azure Open AI, and ChatGPT to sift through large amounts of structured and unstructured data.
ChatGPT, OpenAI’s advanced language model, is an incredibly powerful tool when it comes to answering queries or generating human-like text. But what if you want to interact with a large amount of your own data, perhaps data that is specific to your organization and not necessarily available on the Internet? This is where Cognitive Search comes in, which can help you index and search your data using advanced AI models.
In this guide, we will explain how you can use these powerful tools to build a web application that enables you to chat with your own data.
Here’s an overview of the architecture of the system we’re going to implement:
To get started, you need to have Azure OpenAI and Azure Cognitive Search enabled in your Azure subscription. Once these services are ready, you can leverage this demo repository, which will set up the necessary infrastructure for you.
The repository deploys several resources including
You can deploy the repository via GitHub Codespaces or VS Code Remote Containers. For the purpose of this guide, we will use GitHub Codespaces.
Before deploying the repository, you might want to replace the sample data with your own. To do this:
data
folder in the repository.Upload your own PDF files by right-clicking on the data
folder and selecting Upload
.
Remember that the data you upload here is what you will be able to query using the web application.
In the notebook
folder, there’s a notebook named Chat-Retrieve-Refine.ipynb
. This notebook contains the prompt you will be using for your ChatGPT model. By default, the prompt is set up to ask questions about a healthcare plan, which is related to the sample data provided. However, you can customize the prompt to suit your needs.
Once you’ve set up your data and prompt, it’s time to deploy the repository.
azd init azure-search-openai-demo
command.azd up
to deploy the project.The deployment creates a new resource group and deploys all the services, including the ChatGPT model. This process may take several minutes.
Let’s validate the ChatGPT-3.5 Module used in the Azure AI to process our company Data, to do so we have to jump to the Azure AI Studio portal (https://oai.azure.com/portal)and look into the module section.
As shown in the screen above we have ChatGPT 3.5 Turbo built in our environment.
Congratulations! now you have a fully functional web application where you can chat with your data using Azure Cognitive Search and ChatGPT. The application fetches relevant information from your dataset and generates an appropriate response using ChatGPT. This can be a powerful tool for organizations dealing with large, complex datasets.
The integration offers a number of benefits for enterprises, including:
Use Cases for ChatGPT and Azure Cognitive Search
ChatGPT and Azure Cognitive Search can be used in a variety of use cases, including:
Here are some common questions and answers related to data, privacy, and security for the Azure OpenAI Service (ChatGPT):
Prompts and completions. The prompts and completions data may be temporarily stored by the Azure OpenAI Service in the same region as the resource for up to 30 days. This data is encrypted and is only accessible to authorized Microsoft employees for (1) debugging purposes in the event of a failure, and (2) investigating patterns of abuse and misuse to determine if the service is being used in a manner that violates the applicable product terms. Note: When a customer is approved for modified abuse monitoring, prompts and completions data are not stored, and thus Microsoft employees have no access to the data.
These answers provide a brief overview, but you can find more detailed information in Microsoft’s data processing, privacy, and security documents for Azure OpenAI.
The integration of ChatGPT and Azure Cognitive Search offers a powerful and versatile solution for enterprises that are looking to improve their data analysis capabilities. By combining the strengths of these two technologies, businesses can gain a competitive edge by making better decisions, improving customer service, and driving innovation.
In this session, we will explore the architecture and best practices for building secure and…
Introduction Welcome to our comprehensive series on Azure Web Application Firewall (WAF) security! In this…
Introduction Welcome to the third installment of our Azure Web Application Firewall (WAF) Security Lab…
Introduction Welcome to the second installment of our Azure Web Application Firewall (WAF) Security Lab…
Introduction Welcome to the first installment of our four-part Azure Web Application Firewall (WAF) Security…
Introduction In today's digital landscape, protecting web applications from sophisticated attacks is crucial. Azure Web…