Discover books that fit your mood, category, or desired tone with Semantic Book Recommender. This project combines the power of AI embeddings from Hugging Face, natural language processing, and a user-friendly Gradio interface to deliver a personalized book recommendation experience.
- Natural Language Search: Find book recommendations based on a description or a query in natural language.
- Category Filtering: Refine your results by selecting specific book categories (e.g., Fiction, Self-help).
- Emotional Filtering: Get book recommendations based on emotional tones like Happy, Sad, Suspenseful, and more.
- User-friendly Interface: Built using Gradio, making it interactive and accessible for all users.
The Semantic Book Recommender uses the following steps:
- Loads a dataset of books with metadata, emotional scores, and descriptions.
- Leverages Hugging Face's
sentence-transformers/all-MiniLM-L6-v2model to generate embeddings for book descriptions. - Embeds user queries using the same model.
- Retrieves the most semantically similar books using Chroma as the vector database engine.
- Filters recommendations further based on user-selected category and emotional tone.
.
├── app.py # Main application file with Gradio logic
├── books_with_emotions.csv # Dataset containing books metadata, emotions, and thumbnails
├── tagged_description.txt # File with tagged descriptions for semantic embeddings
├── requirements.txt # List of Python dependencies
├── .env # Environment variables (for any OpenAI & Huggingface API keys)
└── README.md # This README fileTo run the Semantic Book Recommender locally:
-
Clone the Repository:
git clone https://github.com/asshejan/Book-Recommender.git cd Book-Recommender -
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
python app.py
-
Open your browser and go to
http://127.0.0.1:7860.
Make sure you have the following libraries installed (or listed in requirements.txt):
gradiolangchainsentence-transformerspandasnumpypython-dotenvchromadb
You can install them with:
pip install -r requirements.txtFeel free to contribute to the Semantic Book Recommender by:
- Submitting bug reports or feature requests.
- Adding new functionality (e.g., more emotional tones, better search algorithms).
- Cleaning and improving the existing code.
If you have any questions or run into issues, feel free to contact me:
- GitHub: Abu Sayeam Shejan
Special thanks to:
- Hugging Face for their awesome
sentence-transformers. - Gradio for making interactive machine learning applications easy to build.
- LangChain for simplifying AI workflows.
Enjoy discovering a world of books with Semantic Book Recommender! 📚✨
