From the course: Advanced LLMs with Retrieval Augmented Generation (RAG): Practical Projects for AI Applications

Unlock this course with a free trial

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

Hands-on lab: Content embedding

Hands-on lab: Content embedding

- So, so far the improvement that we did when using the open source was to understand better how it works, to save on the speed latency of calling the endpoint, and saving on the cost, but also reducing the size of the vector. So, now we have a 384 compared to five times the size, if you're using the OpenAI. Sometimes bigger is better, sometimes smaller is better, but anyway, it's not much of an improvement overall. Now let's check another example of a model that improves on the overall embedding accuracy for the retrieval part. So we will use two things here. One is the bi-encoder. That means that we can encode different parts of the dataset differently, in the sense, the documents and the queries. The second thing is that it will calculate a contextual embedding based on some sample documents. This is the best improvement over the naive embedding compared to a more complicated fine tuning process that we can do. We're going to load our transformers from from the hub. You can see…

Contents