FAISS
FAISS is a powerful library designed for efficient similarity search and clustering of dense vectors. It offers various algorithms for searching in sets of vectors, even when the data size exceeds the available RAM. Developed primarily at Meta’s Fundamental AI Research group, Faiss provides complete wrappers for Python/numpy and supports GPU implementations for faster performance.
How will this help?
FAISS can be used to store data as high-dimensional vectors, enabling fast and efficient similarity search and retrieval of data based on their vector representations. You can use UpTrain along with FAISS for evaluations such as the relevance of the retrieved context ensuring a good retrieval quality.
How to integrate?
First, let’s import the necessary packages
Let’s define a dataset
Choose an embedding model:
Generate embedding and vectorise from the defined text
Define question and fetch relevant information from FAISS
Evaluate the retrieval quality using UpTrain
Let’s look at the retrieval quality of the context documents
According to these evaluations:
- Example 1: The context contains information about a book “A Gift From The Stars”, which is related to the question asked i.e. books about alien abductions.
- Example 2: The context contains information about a book “The Royal Abduction”, which is related to a abduction but there is no reference specific to alien abduction, making the context irrelevant.
Was this page helpful?