{"id":125,"date":"2025-06-18T15:51:51","date_gmt":"2025-06-18T15:51:51","guid":{"rendered":"https:\/\/blog.chataignon.org\/joseph\/?p=125"},"modified":"2025-06-18T15:53:02","modified_gmt":"2025-06-18T15:53:02","slug":"introducing-my-word-embeddings-visualizer","status":"publish","type":"post","link":"https:\/\/blog.chataignon.org\/joseph\/post-125\/introducing-my-word-embeddings-visualizer\/","title":{"rendered":"Introducing my Word Embeddings Visualizer"},"content":{"rendered":"\n<p>Access link for the visualizer: <a href=\"https:\/\/word-embeddings.wbkolleg.unibe.ch\/\">https:\/\/word-embeddings.wbkolleg.unibe.ch\/<\/a><br>Repository: <a href=\"https:\/\/gitlab.com\/JChataigne\/embeddings-visualiser\">https:\/\/gitlab.com\/JChataigne\/embeddings-visualiser<\/a><\/p>\n\n\n\n<p>As an engineering student learning about neural networks in 2017, before Transformers were introduced, one of the most intriguing and funny things I discovered was that one could apply arithmetic to word embeddings and it actually seemed to make sense. To quote the <a href=\"https:\/\/arxiv.org\/abs\/1301.3781\">paper<\/a> that introduced this notion:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Somewhat surprisingly, it was found that similarity of word representations goes beyond simple syntactic regularities. Using a word offset technique where simple algebraic operations are performed on the word vectors, it was shown for example that vector(\u201dKing\u201d) &#8211; vector(\u201dMan\u201d) + vector(\u201dWoman\u201d) results in a vector that is closest to the vector representation of the word Queen.<br>In this paper, we try to maximize accuracy of these vector operations by developing new model architectures that preserve the linear regularities among words.<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>This is a nice, intuitive way to show how vectors can capture semantics. This particular example (\u00ab\u00a0King\u00a0\u00bb &#8211; \u00ab\u00a0Man\u00a0\u00bb + \u00ab\u00a0Woman\u00a0\u00bb \u2248 \u00ab\u00a0Queen\u00a0\u00bb) is still very often used in introductory courses.<\/p>\n\n\n\n<p>But when taking, and later teaching such classes, I always found it disappointing that the examples were fixed, because (1) they could have been cherry-picked to make the phenomenon seem more consistent and (2) I couldn&rsquo;t explore more examples. The only way to see more examples was to run the code yourself, which requires either more time or more skill than people typically have.<\/p>\n\n\n\n<p>So I took a few days to build a word embedding visualizer, and made it public. You can now go to <a href=\"https:\/\/word-embeddings.wbkolleg.unibe.ch\/\">this link<\/a> to try it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"437\" src=\"https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-1024x437.png\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-1024x437.png 1024w, https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-300x128.png 300w, https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-768x328.png 768w, https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-1536x655.png 1536w, https:\/\/blog.chataignon.org\/joseph\/wp-content\/uploads\/sites\/2\/2025\/06\/Screenshot_20250618_173240-2048x874.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I have also made a version to visualize document embeddings, but I don&rsquo;t have a server to host that one at the moment. You can still run it locally since the code is public.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Access link for the visualizer: https:\/\/word-embeddings.wbkolleg.unibe.ch\/Repository: https:\/\/gitlab.com\/JChataigne\/embeddings-visualiser As an engineering student learning about neural networks in 2017, before Transformers were [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[15,30],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-ai","category-project"],"_links":{"self":[{"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":3,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/posts\/125\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chataignon.org\/joseph\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}