<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Co-Occurrence on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/co-occurrence/</link>
    <description>Recent content in Co-Occurrence on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 07 Sep 2026 09:20:00 +0000</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/co-occurrence/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Learning an Embedding Space</title>
      <link>http://programmer.ie/books/embeddings-from-first-principles/03-chapter/</link>
      <pubDate>Mon, 07 Sep 2026 09:20:00 +0000</pubDate>
      <guid>http://programmer.ie/books/embeddings-from-first-principles/03-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Part I — A Vector Is Not Meaning&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;counting-words-in-a-tiny-corpus&#34;&gt;Counting words in a tiny corpus&lt;/h2&gt;&#xA;&lt;p&gt;Six sentences:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The cat drinks milk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The dog drinks water&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The kitten drinks milk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The puppy drinks water&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The cat chases the mouse&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The dog chases the cat&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Build a co-occurrence matrix: for each word, count how often each other word appears within one step of it.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          cat  dog  kitten  puppy  milk  water  drinks  chases  mouse&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cat        -    1     0      0      0     0      1       2       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dog        1    -     0      0      0     0      1       1       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kitten     0    0     -      0      1     0      1       0       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;puppy      0    0     0      -      0     1      1       0       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;milk       0    0     1      0      -     0      2       0       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;water      0    0     0      1      0     -      2       0       0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Each row is already a crude embedding: &lt;code&gt;kitten&lt;/code&gt; and &lt;code&gt;milk&lt;/code&gt; co-occur; &lt;code&gt;puppy&lt;/code&gt; and &lt;code&gt;water&lt;/code&gt; co-occur. The rows for &lt;code&gt;cat&lt;/code&gt; and &lt;code&gt;dog&lt;/code&gt; look alike because both chase and drink.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
