This is a semantic search–based book recommendation system that uses natural language processing to recommend books based on user input. Instead of relying on fixed keywords or categories, it understands the meaning behind your input using sentence embeddings.
- Uses
sentence-transformers
(Hugging Face) to generate semantic embeddings from book descriptions. - To create your own vector database, you’ll need a .env file in the root directory containing either your OpenAI API key or Hugging Face token.
- Stores and searches embeddings using FAISS (Facebook AI Similarity Search).
- A Gradio interface that allows users to enter a query and receive book recommendations.
- Input can be anything — a topic, mood, summary, or even a quote — and you'll get the most semantically relevant books.
- Python
- LangChain
- Hugging Face Transformers
- FAISS
- Gradio
- Pandas
To run this project on Replit or Gitpod:
- Copy the contents of
.env.example
into a new file named.env
in the root directory. - Paste your Hugging Face token or OpenAI API key
git clone https://github.com/BusraRafa/Semantic-Book-Recommender.git
cd Semantic-Book-Recommender
python -m venv myenv
source myenv/bin/activate # For Linux/macOS
myenv\Scripts\activate # For Windows
A requirements.txt file containing all the project dependencies is provided as part of this repo.
pip install -r requirements.txt
python gradio-dashboard.py
Once launched, open the app in your browser at: 👉 http://127.0.0.1:7860
dashboard.launch(share=True)