Skip to content

Interactive book recommender leveraging LLMs, semantic embeddings, zero-shot classification, and emotion-based filtering for precise, intelligent recommendations.

Notifications You must be signed in to change notification settings

Sarach-git/Book-Recommendation

Repository files navigation

LLM-Powered Semantic Book Recommender

A user-friendly, interactive book recommendation system that leverages large language models (LLMs), semantic embeddings, and NLP techniques to provide precise content-based recommendations. Users can filter by category and emotional tone, enabling nuanced book discovery beyond keyword matching.


Table of Contents


Project Overview

This project builds a semantic book recommender using modern NLP techniques and LLMs. Book descriptions are transformed into vector embeddings, allowing users to find books that closely align with their interests. The system incorporates:

  • Semantic search via vector embeddings
  • Zero-shot classification for category normalization
  • Sentiment/emotion analysis for mood-based filtering
  • Interactive dashboard using Gradio

Features

  • Semantic Book Search: Find books based on meaning rather than exact keywords.
  • Category Filtering: Standardized via zero-shot classification.
  • Emotion Filtering: Filter books by emotional tone using sentiment/emotion analysis.
  • Interactive Dashboard: Real-time exploration of recommendations with thumbnails, descriptions, and author info.
  • User-Friendly Interface: Designed for non-technical users.

Technologies Used

  • Data Processing: Python, Pandas, NumPy
  • LLM & Embeddings: OpenAI embeddings, Hugging Face Transformers
  • Vector Database & Retrieval: LangChain + Chroma
  • Classification & Sentiment Analysis: Hugging Face Zero-Shot Classifiers, fine-tuned RoBERTa
  • Dashboard / Interface: Gradio
  • IDE / Tools: PyCharm

Why: Transformers provide contextual embeddings; LangChain + Chroma enable semantic search; zero-shot classification simplifies messy book categories; Gradio creates a practical interactive dashboard.


How It Works

  1. Data Acquisition & Cleaning:

    • Dataset: 7K Books Kaggle Dataset
    • Cleaning includes handling missing descriptions, standardizing categories, and creating a combined title/subtitle field.
  2. Embeddings & Vector Database:

    • Book descriptions are converted into embeddings using Transformer-based models.
    • Embeddings are stored in a Chroma vector database for fast similarity search.
  3. Query Handling & Recommendation:

    • User input is embedded and compared against stored book embeddings.
    • Top-k similar books are retrieved.
  4. Filtering & Enhancement:

    • Category filtering: via Hugging Face zero-shot classification
    • Emotion filtering: fine-tuned RoBERTa model assigns emotional tones to book descriptions
  5. Dashboard Display:

    • Results presented on a Gradio interface with book thumbnails, authors, and filtered recommendations.

Setup & Installation

  1. Clone the repository:
[git clone https://github.com/Sarach-git/Book-Recommendation.git
cd book-recommender

About

Interactive book recommender leveraging LLMs, semantic embeddings, zero-shot classification, and emotion-based filtering for precise, intelligent recommendations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published