{"id":29253449,"url":"https://github.com/simrandalal/semantic-book-recommender","last_synced_at":"2026-04-05T08:34:26.965Z","repository":{"id":302695626,"uuid":"1013321848","full_name":"simrandalal/semantic-book-recommender","owner":"simrandalal","description":"A semantic content-based book recommender using sentence-transformer embeddings, cosine similarity, and a Streamlit interface.","archived":false,"fork":false,"pushed_at":"2025-07-03T18:41:06.000Z","size":218,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T05:43:27.787Z","etag":null,"topics":["dotenv","huggingface-transformers","nlp-machine-learning","pandas","python","scikit-learn","similarity-search","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simrandalal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T17:48:34.000Z","updated_at":"2025-07-03T18:48:50.000Z","dependencies_parsed_at":"2025-07-03T19:37:23.235Z","dependency_job_id":null,"html_url":"https://github.com/simrandalal/semantic-book-recommender","commit_stats":null,"previous_names":["simrandalal/semantic-book-recommender"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simrandalal/semantic-book-recommender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simrandalal%2Fsemantic-book-recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simrandalal%2Fsemantic-book-recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simrandalal%2Fsemantic-book-recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simrandalal%2Fsemantic-book-recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simrandalal","download_url":"https://codeload.github.com/simrandalal/semantic-book-recommender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simrandalal%2Fsemantic-book-recommender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31430009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotenv","huggingface-transformers","nlp-machine-learning","pandas","python","scikit-learn","similarity-search","streamlit"],"created_at":"2025-07-04T02:02:25.412Z","updated_at":"2026-04-05T08:34:26.937Z","avatar_url":"https://github.com/simrandalal.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 Semantic Book Recommender\n\nA powerful content-based book recommendation system that leverages semantic similarity using state-of-the-art language models. Instead of relying on keyword matches, it understands the *meaning* of a user query and returns the most relevant books.\n\n---**How it works:**\n\n- **Text Embedding**  \n  The system uses a transformer-based model from Hugging Face (Sentence Transformers) to convert book descriptions into dense vector representations, capturing their semantic meaning.\n\n- **Query Vectorization**  \n  When a user enters a search query, it is also converted to a vector using the same model, so both books and queries are in the same semantic space.\n\n- **Similarity Search**  \n  The recommender calculates the cosine similarity between the query vector and each book’s description vector. Cosine similarity is a mathematical metric that measures the angle between two vectors in a high-dimensional space:\n  - a cosine score close to 1 means they are very similar\n  - a cosine score close to 0 means they are unrelated\n\n- **Ranking and Recommendation**  \n  The system ranks all books by their similarity score to the user query and shows the most relevant recommendations.\n\n- **Streamlit User Interface**  \n  The final results are displayed through an intuitive Streamlit web app, where users can input their queries and immediately see recommendations with book details.\n\n---\n\n\n\n\n## 🚀 Features\n\n✅ Semantic matching using Sentence Transformers  \n✅ Content-based recommendations (no user history required)  \n✅ Fast cosine similarity search  \n✅ Streamlit web interface for easy use  \n✅ Modular and extendable architecture  \n\n---\n\n## 🛠️ Tech Stack\n\n- **Python 3**\n- Streamlit\n- Sentence Transformers (Hugging Face)\n- Pandas\n- scikit-learn\n- dotenv\n\n---\n\n\n## ⚙️ Setup \u0026 Installation\n\n\u003e **Note**: Make sure you have Python installed, and your `.env` file created with your Hugging Face token.\n\n```bash\ngit clone https://github.com/simrandalal/semantic-book-recommender.git\ncd semantic-book-recommender\npip install -r requirements.txt\n\n\nThen add a .env file:\nHUGGINGFACEHUB_API_TOKEN=your_token_here\n\nand place your dataset in the data/ folder (expected as a CSV with book details).\n\n## ▶️ How to Run\nstreamlit run app.py\nThis will launch the app on localhost:8501 in your browser.\n\n## 📊 Dataset\nDataset is excluded for privacy.\nYou can use your own CSV dataset with columns like:\n\ntitle\nauthor\ndescription\n\n## 💡 How It Works\n✅ Loads book descriptions\n✅ Embeds them into semantic vectors with a transformer model\n✅ Calculates cosine similarity to find the closest matches\n✅ Displays them interactively via Streamlit\n\n\n## 🌟 Future Enhancements\n- Add user ratings and collaborative filtering\n- Pagination for large datasets\n- Deploy to cloud (e.g., Streamlit Cloud, Heroku)\n- Add genre-based filtering\n\n## 🤝 Contributing\nPRs are welcome! Please open an issue first to discuss proposed changes.\n\n📝 License\nThis project is licensed under the MIT License.\n\n🙋‍♀️ Author\nSimran Dalal\nGitHub\n\nFeel free to adapt or ask me to edit this further — I’m here to help! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimrandalal%2Fsemantic-book-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimrandalal%2Fsemantic-book-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimrandalal%2Fsemantic-book-recommender/lists"}