An intelligent book recommendation system that combines Semantic Search, Large Language Models (LLMs), Text Classification, and Sentiment Analysis to recommend books based on natural language descriptions and emotional preferences.
Users can describe the type of book they are looking for, select a category and emotional tone, and receive personalized recommendations through an interactive Gradio dashboard.
- Semantic book search using vector embeddings
- Natural language queries
- Category-based filtering
- Emotion-aware recommendations
- Interactive web interface with Gradio
- Book cover previews and descriptions
- Vector database powered by ChromaDB
- LangChain
- Hugging Face Transformers
- Sentence Transformers
- OpenAI API (optional)
- Chroma Vector Database
- Pandas
- NumPy
- Gradio
- Matplotlib
- Seaborn
- Python 3.11
- Jupyter Notebook
- python-dotenv
- Load and clean book metadata.
- Extract and preprocess book descriptions.
- Create structured text documents for vectorization.
- Generate embeddings for book descriptions.
- Store embeddings in a Chroma vector database.
- Retrieve semantically similar books based on user queries.
- Classify books into simplified categories.
- Create category mappings for filtering recommendations.
-
Analyze emotional characteristics of book descriptions.
-
Generate emotion scores such as:
- Joy 😊
- Sadness 😢
- Fear 😨
- Anger 😠
- Surprise 😲
- Combine semantic similarity with category and emotion filters.
- Rank and return the most relevant books.
- User-friendly interface for interacting with the recommendation engine.
- Display book covers, titles, authors, and summaries.
This project uses the 7K Books with Metadata dataset from Kaggle:
https://www.kaggle.com/datasets/dylanjcastillo/7k-books-with-metadata
Dataset includes:
- ISBN
- Title
- Authors
- Categories
- Descriptions
- Thumbnails
- Publication information
- Python 3.11
kagglehub==0.3.5
pandas==2.2.3
matplotlib==3.10.0
seaborn==0.13.2
python-dotenv==1.0.1
langchain-community==0.3.27
langchain-openai==0.3.28
langchain-chroma==0.2.5
langchain-huggingface
transformers==4.47.1
gradio==5.38.2
notebook
ipywidgets==8.1.5
Install dependencies:
pip install -r requirements.txtgit clone <repository-url>
cd Book-Recommenderpython gradio-dashboard.pyThe application will launch locally and open an interactive recommendation dashboard.
Input:
A story about forgiveness, friendship, and personal growth.
Filters:
- Category: Fiction
- Tone: Happy
Output:
A list of semantically similar books ranked according to the selected emotional tone and category.
- Hybrid search (semantic + keyword)
- Multi-language recommendations
- User ratings and feedback loop
- Fine-tuned embedding models
- Deployment on Hugging Face Spaces
- Recommendation explanations using LLMs


