From the course: Azure OpenAI in .NET

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Creation embeddings and calculate distance

Creation embeddings and calculate distance - .NET Tutorial

From the course: Azure OpenAI in .NET

Creation embeddings and calculate distance

- [Instructor] I have prepared two examples here. First, we calculate embeddings and then calculate the cosine distance from a question or keyword to those embeddings that we have created. And the second example where we will use a vector database. And in this specific case, I will use Azure Semantic Search as the vector database where we can store embeddings, and then where we can query those embeddings. Let me now switch to my Visual Studio Code environment, and I have the necessary examples provided in the folder 03. So when you open the folder 03, you will find two notebooks. One notebook is called SDK_Embeddings, and the other one is called SDK_Vector_Database. So let's start with the SDK_Embeddings notebook. Let me open this notebook. And in this notebook we see the necessary C# code to create the embeddings and then calculate the cosine distance between embeddings and a keyword, a phrase or a question. So the…

Contents