Skip to content

Embeddings

Barry Stahl edited this page Jan 13, 2024 · 4 revisions

Embeddings Demos

This code demonstrates a variety of ways that embeddings can be used to represent and reason about textual data. It also exposes just a few of the many biases inherent in the model and demonstrates a few methods of using embeddings in operational contexts.

All of these demos come in the form of XUnit tests. To run them, open the Embeddings.sln solution in Visual Studio and run the tests in the ADA2.Embeddings.Test project, or execute the dotnet test command from the ADA2.Embeddings.Tests directory.

Note: These demos will run without the need for an Azure account because all of the specified embeddings have been cached in the ADA2.Client.Entities.EmbeddingCache provider. Any changes to the words or phrases that need to be embedded will require access to an Azure OpenAI service deployment. See Configuring the OpenAI Service for more information.

Demonstrates how embeddings encode both semantic and contextual information of words and phrases.

Demonstrates how vector math can be used to reason about the relationships between words and phrases.

Demonstrates how embeddings models can be biased and how to expose specific biases.

Demonstrates how unstructured data can be categorized into known groups using embeddings models.

Demonstrates how embeddings models can be used to detect the polarity of text.

Demonstrates how embeddings models can be used to perform sentiment analysis.