{"id":29201953,"url":"https://github.com/bdr-pro/embeddings-similarity","last_synced_at":"2026-06-25T12:31:36.254Z","repository":{"id":295768805,"uuid":"991180051","full_name":"BDR-Pro/Embeddings-similarity","owner":"BDR-Pro","description":"Sentence Embedding Similarity Visualizer (Manim)","archived":false,"fork":false,"pushed_at":"2025-05-28T10:49:25.000Z","size":410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T12:49:49.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/BDR-Pro.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-05-27T08:41:17.000Z","updated_at":"2025-05-28T10:49:29.000Z","dependencies_parsed_at":"2025-05-27T10:05:58.960Z","dependency_job_id":null,"html_url":"https://github.com/BDR-Pro/Embeddings-similarity","commit_stats":null,"previous_names":["bdr-pro/embeddings-similarity"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BDR-Pro/Embeddings-similarity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2FEmbeddings-similarity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2FEmbeddings-similarity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2FEmbeddings-similarity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2FEmbeddings-similarity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BDR-Pro","download_url":"https://codeload.github.com/BDR-Pro/Embeddings-similarity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2FEmbeddings-similarity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266640830,"owners_count":23960809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-07-02T12:36:34.155Z","updated_at":"2026-06-25T12:31:36.074Z","avatar_url":"https://github.com/BDR-Pro.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Sentence Embedding Similarity (Local)\n\nThis simple Python script uses `sentence-transformers` to compute and visualize sentence embeddings and their cosine similarity.\n\n\n[Colab Ipynb](https://colab.research.google.com/drive/1Mz-QT4492QJEqH3-cxpR7KbowucRGi8H?usp=sharing)\n\n\n## 🔍 Features \n\n- Loads a small, efficient embedding model: `all-MiniLM-L6-v2`\n- Encodes a set of example sentences into dense vector embeddings\n- Computes **pairwise cosine similarity matrix**\n- Performs a **semantic search** for the most similar sentences to a query\n- Outputs a ranked list of closest matches\n\n## 🚀 Run Instructions\n\n### 1. Install Dependencies\n\n```bash\npip install sentence-transformers scikit-learn pandas\n````\n\n### 2. Run the Script\n\n```bash\npython sentence_similarity.py\n```\n\nOr use a Jupyter Notebook if you're working interactively.\n\n## 🧾 Output Example\n\nExample query:\n\n```\n\"Hot pizza from the oven\"\n```\n\nTop similar sentences:\n\n```\nA pizza is baking in the oven  (score: 0.57)\nThe oven is very hot           (score: 0.47)\nI like pizza                   (score: 0.37)\n```\n\n## 📊 Pairwise Similarity Matrix (visual in notebook)\n\n|              | I like pizza | The dog... | A pizza... | He enjoys... | The oven... | She loves... |\n| ------------ | ------------ | ---------- | ---------- | ------------ | ----------- | ------------ |\n| I like pizza | 1.000        | 0.057      | 0.409      | ...          | 0.244       | 0.284        |\n| ...          | ...          | ...        | ...        | ...          | ...         | ...          |\n\nStyled with a blue gradient using Pandas.\n\n## 💡 Notes\n\n* This is a fully **local** setup – no API or external service calls\n* Uses cosine similarity to reflect **semantic closeness** of sentences\n* Useful for quick NLP prototyping or exploring sentence relationships\n\n## 📊 Sentence Embedding Similarity Visualizer (Manim)\n\nThis project visualizes **cosine similarity** between sentence embeddings using the [Manim](https://docs.manim.community/) animation engine.\n\n## 🎯 Features\n\n- Shows sentence vectors as arrows in 2D space\n- Animates sentence labels\n- Annotates cosine similarity between selected vectors\n- Uses **precomputed cosine similarity** (no model required)\n\n## 🛠️ Requirements\n\n```bash\npip install manim\n````\n\n(Use a virtualenv if needed)\n\n## 🚀 Run\n\n```bash\npython -m manim -pql embeddings.py VisualizeCosineSimilarity\n```\n\n* `-pql`: Preview in low quality (for faster rendering)\n* You can also use `-pqh` for high quality or `-qm` for medium\n\n## 🧠 How It Works\n\n* Positions of arrows are **manually defined** to reflect semantic similarity visually\n* Cosine similarity is precomputed and displayed during the animation\n* No need to load or compute SentenceTransformer models at runtime\n\n## 🧾 Example Output\n\nYou’ll see 6 arrows, each representing a sentence like:\n\n```\nI like pizza\nThe oven is very hot\nShe loves climbing rocks\n...\n```\n\nAnd similarity score annotations like:\n\n```\ncosine = 0.41\n```\n\n## 📁 Files\n\n* `embeddings.py`: Manim animation script\n* `README.md`: You are here\n\n## 🧩 To Extend\n\n* Animate angles using `Angle()` in Manim\n* Import sentence embeddings and do PCA live\n* Add fade-in comparisons or a slider over time\n\n---\n\nMIT License – Use and modify freely!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fembeddings-similarity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdr-pro%2Fembeddings-similarity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fembeddings-similarity/lists"}