~/projects/semantic-books

Semantic Book Recommender

Recommends books by meaning rather than keywords, combining vector search with zero-shot genre classification and emotion scoring.

Status
Completed
Context
Completed project
Type
Applied NLP
GitHubLive site · soonRead the write-up

01Problem

Keyword matching misses books that fit what a reader describes in meaning but not in exact words.

02What I built

  • Embedded book descriptions with Sentence Transformers and searched them in ChromaDB.
  • Added zero-shot genre classification with BART-MNLI and emotion scoring with DistilRoBERTa.
  • Built a Gradio interface for exploring recommendations.
  • Fixed a GPU compatibility issue using a PyTorch nightly build with CUDA 12.8 support.

03How it works

  1. Reader’s description
  2. Embedding
  3. ChromaDB search
  4. Genre and emotion filters
  5. Gradio results

04Decisions

DecisionWhyTrade-off
Search by meaningKeyword matching misses books that fit a description in meaning but not in wording.Recommendation quality has not been formally benchmarked.
Pretrained zero-shot modelsGenre and emotion signals without training my own classifiers.Limited to what the pretrained models already capture.
PyTorch nightly with CUDA 12.8Fixed a GPU compatibility issue.Nightly builds are less stable than releases.

05Result

Outcome

A working recommender that combines semantic search with genre and tone, built on pretrained models.

Limitations

Uses pretrained models rather than ones I trained. Recommendation quality has not been formally benchmarked.

Stack

PythonLangChainChromaDBSentence TransformersHugging FaceBART-MNLIDistilRoBERTaGradio

06Related writing

How Vector Embeddings Help AI Understand Meaning on Medium.