The representation seems expensive to me...

If we were to store each float as a separate DB field, it would be rather expensive. This is why the AI::Embedding documentation suggests storing the vector as a string in a TEXT field. See the embedding method

Because the purpose of an embedding is to compare it with another embedding, the floats that make up the vector are dealt with as a single unit. Generally, we have no reason to access the individual components of the vector.

The vector comparison is carried out internally with Data::CosineSimilarity.

This compiles but gets lost in runtime:

From a cursory look, I'm not sure what to make of that error!

The problem is in a private method but I cannot recall where it's called from. I shall look into this further over the next few days when I've got a little more time...I'm on domestic duties, making the house look festive right now!

AI::Embedding is working in a production environment, so I am hopeful there isn't a fundamental problem with the module. But it shouldn't really thrown the error you are experiencing.


In reply to Re^3: perl hooks for AI by Bod
in thread perl hooks for AI by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.