Discover your next favorite read with the power of Large Language Models (LLMs). BookWise uses semantic search, sentiment analysis and zero-shot classification to recommend books tailored to your preferences.
This project is a comprehensive guide to building a semantic book recommender system using LLMs. It covers the following key steps:
- Cleaning and preprocessing text data.
- Building a vector database for semantic search.
- Classifying books using zero-shot classification.
- Performing sentiment analysis to extract emotions from text.
- Creating a web application for users to interact with the recommender system.
The project is divided into five main components, each implemented in a separate Jupyter notebook or Python script:
-
Data Exploration and Cleaning
- Notebook:
data-exploration.ipynb - Cleans and preprocesses the text data for further analysis.
- Notebook:
-
Semantic Search and Vector Database
- Notebook:
vector-search.ipynb - Builds a vector database to enable semantic search, allowing users to find books similar to a natural language query (e.g., "a book about a person seeking revenge").
- Notebook:
-
Text Classification
- Notebook:
text-classification.ipynb - Uses zero-shot classification to classify books as "fiction" or "non-fiction," enabling users to filter books by genre.
- Notebook:
-
Sentiment Analysis
- Notebook:
sentiment-analysis.ipynb - Performs sentiment analysis to extract emotions from text, allowing users to sort books by tone (e.g., suspenseful, joyful, or sad).
- Notebook:
-
Web Application
- File:
gradio-dashboard.py - Creates a user-friendly web application using Gradio for book recommendations.
- File:
To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/imad2702/BookWise.git cd BookWise - Install the required dependencies:
pip install -r requirements.txt
- Create a .env file in the root directory and add your GoogleAPI key:
GOOGLE_API_KEY=your_api_key_here
- Download the dataset from Kaggle and place it in the appropriate directory. Follow the instructions in the repository for downloading the data.
- Running the Notebooks
- Open the Jupyter notebooks in the order specified above to explore the data, build the vector database, classify books and perform sentiment analysis.
- Running the Web Application
- Execute the Gradio dashboard script to launch the web application:
python gradio-dashboard.py
- Access the application via the provided local URL.
-
Libraries and Frameworks:
- pandas, matplotlib, seaborn for data manipulation and visualization.
- langchain-community, langchain-chroma, transformers for LLM integration and semantic search.
- gradio for building the web application.
- python-dotenv for managing environment variables.
-
APIs: Google API for LLM functionalities.