From the course: Programming Generative AI: From Variational Autoencoders to Stable Diffusion with PyTorch and Hugging Face

Unlock this course with a free trial

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

Semantic search with embeddings

Semantic search with embeddings

- [Instructor] And as kind of a more practical example of how you might use these embeddings, now, typically with embeddings, it's often used in the context of something like a retrieval-augmented generation, or RAG, where you might have something like a database or a corpus of documents or sentences that have their embeddings pre-computed. You might have a query that you are trying to find the most relevant document, similar to something like semantic search or a search engine. So in this case, let's suppose that we have some query or just some prompt about thermodynamics, and we have a corpus. So these are just sentences taken from random Wikipedia articles, kind of across a spread of topics. We have one about animals of a forest falcon. This one is just kind of a prompt that I wrote about me going to the store to get some milk. We have some things that are computer sciencey or mathy, like softmax function, some computer science hardware, like databases. We have statistical…

Contents