This project is a Streamlit app that performs semantic search over a food dataset using FAISS indexing, SVD compression, and optional GPT-based reranking.
- Search food items using vector embeddings
- Choose between large/small embedding models
- Apply SVD to approximate similarity
- GPT-based reranking and optional NDCG evaluation
Example:
- Clone this repository and navigate into the folder:
git clone https://github.com/cookbook-ms/semantic_search_llm.git
cd semantic_search_llm- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt-
Configure api for embedding and gpt responses in 'constants.py':
-
[Optional] Precompute the embeddings for the items and queries. See 'embedding_items.ipynb' and 'embedding_queries.ipynb' for details.
-
Run the Streamlit app:
streamlit run main.py