Skip to content

๐Ÿ’ก AI-powered book recommender using semantic search, LangChain, and OpenAI embeddings. Built with Gradio and deployed on Hugging Face.

Notifications You must be signed in to change notification settings

Ramaruva/Book_Recommender

Repository files navigation

๐Ÿ“š Semantic Book Recommender with OpenAI + LangChain + Gradio

This project is an intelligent Book Recommendation System that leverages Semantic Search, Large Language Models (LLMs), and emotion-based filtering to suggest books that match the intent and tone of your input, not just keywords. Powered by OpenAI, LangChain, and hosted on Hugging Face Spaces with an interactive Gradio UI.


๐Ÿ” Key Features

  • ๐Ÿ”Ž Semantic Search: Finds books based on the meaning of your input using OpenAI embeddings
  • ๐ŸŽญ Emotion-Aware Filtering: Choose tones like Happy, Sad, Suspenseful, etc.
  • ๐Ÿ“– Category-Based Filtering: Refine by genre or theme
  • ๐Ÿง  LLM-Enhanced Retrieval: Uses LangChain to manage document embeddings
  • โšก Gradio Interface: Fast and intuitive web-based user interface
  • ๐ŸŒ Hosted on Hugging Face Spaces

๐Ÿ’ก Example Use Cases

  • โ€œBooks about overcoming failure with a hopeful endingโ€
  • โ€œSomething dystopian with a strong female leadโ€
  • โ€œBooks that make you cry but also inspireโ€

๐Ÿ–ผ Interface Preview

img.png


โš™๏ธ How It Works

  1. Book Metadata & Descriptions are loaded from a dataset
  2. Descriptions are embedded using OpenAIEmbeddings (via LangChain)
  3. A Chroma vector store is created for semantic similarity search
  4. The user enters a natural language query
  5. Relevant book descriptions are matched semantically
  6. Optional filters by category and emotion tone are applied
  7. Gradio Gallery displays recommended books with thumbnails and summaries

๐Ÿ›  Tech Stack

Layer Tools/Libraries
Language Python 3
LLM Embedding OpenAI API (text-embedding-ada-002)
Retrieval LangChain + Chroma + FAISS
UI Framework Gradio (Blocks and Gallery)
Hosting Hugging Face Spaces
Data Handling Pandas, NumPy
Environment Python-dotenv + Hugging Face Secrets

๐Ÿ“ Files in This Repository

  • app.py โ€“ Main app entry (Gradio + LangChain)
  • requirements.txt โ€“ Dependencies for Hugging Face
  • books_with_emotions.csv โ€“ Dataset with book metadata
  • tagged_description.txt โ€“ Description file for embedding
  • cover-not-found.jpg โ€“ Placeholder for missing thumbnails
  • README.md โ€“ You're reading it!

๐Ÿš€ Live Demo

๐Ÿ‘‰ Try the App on Hugging Face Spaces

๐Ÿ™‹โ€๏ธ Author

Ram
๐Ÿ’ผ Passionate about NLP, recommendation systems, and building real-world AI solutions.
๐Ÿ”— LinkedIn

About

๐Ÿ’ก AI-powered book recommender using semantic search, LangChain, and OpenAI embeddings. Built with Gradio and deployed on Hugging Face.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published